Tabraiz Shamsi (C) celebrates with teammates after his dismissal of David Willey (not pictured) during the third T20 match at The Ageas Bowl. AFP
The 32-year-old left-arm wrist-spinner took 5-24 as England, set 192 for victory, collapsed to 101 all out with 20 balls to spare at Southampton after losing their last eight wickets for 49 runs.
Earlier, in-form South Africa opener Reeza Hendricks hit 70 -- his third fifty of the series -- and Aiden Markram made an unbeaten 51 as the Proteas posted a competitive 191-5. Recalled left-arm quick David Willey took 3-25.
Shamsi's haul was all the more impressive given his expensive return of 0-49 in England's series-opening win in Bristol. But South Africa have been much improved in the field since that 41-run defeat and this win gave them a first T20 series success in England, as well as their first white-ball bilateral series victory in the country since 1998. "Before I came to the game, my wife casually said she wants four wickets," Shamsi said at the presentation ceremony.
"And I looked at her to say 'as if you can just buy wickets at a supermarket?'. That's why I was a bit more animated in my celebrations today."
Tabraiz Shamsi walks with the match ball after victory in the third T20 match. AFP
Defeat left England still searching for a first series win under new white-ball captain Jos Buttler following one-day international and T20 reverses against India and a drawn ODI campaign with the Proteas.
Jonny Bairstow (27) was the only England batsman to make more than 20, but Buttler and coach Matthew Mott do have at least seven matches at this level scheduled in Pakistan in September in which to turn things around before the T20 World Cup in Australia.
- 'Reflect' - "The way we went down, is the most disappointing thing," said Buttler. "We lacked intent and confidence and didn't manage to put the opposition under pressure.
"It's not for the lack of trying, we just haven't performed as we'd like to as a group. We have to just go back and reflect. There's a huge competition on the way."
England's chase suffered an early setback when Buttler was out for 14, caught at short third man off spinner Keshav Maharaj.
The out-of-form Jason Roy fell for 17, caught behind off Anrich Nortje — in after South Africa decided against risking fellow fast bowler Kagiso Rabada's injured ankle ahead of next month's three-Test series in England.
And when Moeen Ali was brilliantly caught one-handed by a leaping Tristan Stubbs off part-time spinner Markram, the hosts were 59-4.
Shamsi then cleaned up Liam Livingstone before taking two wickets in two balls, with Sam Curran caught in the deep before Willey was clean bowled.
Chris Jordan survived the hat-trick only to be lbw to Shamsi. Adil Rashid holed out off Shamsi before Maharaj ended the match when he dismissed Bairstow with the aid of a catch by David Miller — a memorable way for the South Africa captain to finish his 100th T20 international.
England's decision to recall Willey in place of Richard Gleeson reaped an early reward when he had Quinton de Kock chopping onto his stumps for a three-ball duck. But South Africa recovered, with Hendrick completing a 42-ball fifty.
He was eventually well caught by wicketkeeper Buttler off the expensive Jordan (1-52). But Markram, back in South Africa's T20 team for the first time since last year's World Cup, having first provided solid support, went on to a 36-ball fifty before Miller chipped in with a quickfire 22.
Needing 149 for victory on a hot and humid day in Cuttack, South Africa rode Klaasen's fourth T20 half-century to achieve their target in 18.2 overs and lead the five-match series 2-0.
The hosts were chasing a target of 177 to finish the series on a high after going down miserably against the visitors in the first two matches. Shanaka scored an unbeaten 54 off 25 balls with five fours and four sixes to seal a four-wicket victory.
The hosts bounced back from 2-0 down to level the series with convincing victories in the absence of top stars including regular captain Rohit Sharma and batting stalwart Virat Kohli.
The Chelsea forward struggled to make an impact in the 2-1 stumble on Wednesday and coach Hansi Flick reacted by taking him out of the side, as one of two changes.
Sheikh Hamdan also sent congratulatory message to the Morocco: “Congratulations to the Atlas Lions... Congratulations to Morocco. You made all Arabs happy with this result. Your victory is deserved and your performance is heroic.”
The Croatians were held to a goalless draw in their group opener against Morocco so Dalic freshened up his attack by bringing in Hajduk Split forward Livaja to operate on the right flank.