England 172 for 8 (Buttler 33, Afridi 3-15) beat Pakistan 169 for 8 (Plunkett 3-33) by three runs
Scorecard and ball-by-ball details
England withstood a late assault from Pakistan's batsmen to secure the T20I series against Pakistan with a match to play.
With 18 balls left of this match, it appeared England were certain of victory: Pakistan, with six wickets down, required 47 to win and the new batsman had only reached double-figures once in his last seven T20I innings.
But that batsman was Shahid Afridi. And though the powers may be waning, he remains a dangerous player. Inspired by a full house audience, he thrashed Chris Woakes for three sixes - one of them off a no-ball - in five deliveries to revive his side's hopes.
While he then fell, slicing a drive to third man where he was well held by a nerveless Liam Plunkett, Sarfraz Ahmed took up the challenge. With 25 required from the final two overs, he swept David Willey for four before, in attempting to complete a quick two from the next delivery, he saw the fielder's throw defeclt off his bat and scurry away for four overthrows. It left 11 required from the final over.
Woakes held his nerve, though. Sarfraz, attempting to sweep a yorker pitched well outside off side, dragged the ball on to his stumps and while Sohail Tanvir clipped his first ball for four, he was unable to maintain the strike. With four required for victory from the final ball - and three for a super over - Anwar Ali heaved at a length ball outside off stump and failed to make contact. England had, for the second time in as many days, won in Dubai.
Despite the result, this was a much-improved performance from Pakistan. Boosted by the return of Ahmed Shehzad, who missed the first game due to illness, and Shoaib Malik, who missed it with a finger injury, they set their highest ever T20I Powerplay score - 54 for 1 - in the UAE.
They were led from the front by Afridi. Introducing himself into attack during the Powerplay, he claimed the wicket of Alex Hales, surprised by Afridi's pace, first ball and later brought himself back to deal with the dangerous James Vince. He finished with 3 for 15 from four overs of rapid spin bowling.
Perhaps they were unlucky, too. Certainly Umar Akmal, well caught down the leg side by Jos Buttler, looked unfortunate to be given out as replays suggested the ball made contact only with his leg.
But there were still those familiar errors in the field. Tanvir dropped two catches - one of which he parried for six - and there were too many times that England were able to steal a single or turn a one into a two. The addition of six wides to the England total also proved crucial.
The first of Tanvir's drops was off Vince. For the second match in succession, he looked a player with the skill and composure to enjoy a good future at this level and here he punished the error by going on to contribute the highest score of the match. To rub salt in the wound, he hit the next three deliveries he received after the drop for six, four and four.
There were several other important contributors in the England order. Jason Roy skipped down the wicket to thrash two sixes over the top in the opening overs, while Buttler hit three - a vast pull, a huge drive and a top-edged hook - in his cameo.
This was a fine game for Buttler. Captaining for the first time in international cricket - England made four changes to the side that won the first game as they sought to take a look at more players ahead of World T20 selection - he ensured his side just about held their nerve towards the end and completed two neat stumpings and claimed one fine catch.
England will be delighted, too, that despite rotating their squad - Eoin Morgan, Moeen Ali, Chris Jordan and Reece Topley were all omitted from this side - they showed they had the skill and composure to beat a Pakistan side that, before this series, were unbeaten in six T20I games. Joe Root, Willey and Woakes all came back into the side alongside Buttler.
It was another good game for Plunkett, too. He took three wickets, an important catch and again bowled with impressive pace to suggest he will be hard to overlook for the World T20 squad.
It was noticeable that, each time Buttler required a wicket, it was Plunkett to who he turned. He responded by having Mohammad Hafeez caught off a leading edge, before Shoaib Malik misjudged a well-disguised slower ball and pulled to deep midwicket.
When Pakistan's openers made a bright start, it seemed England were 10 or so short. But the introduction of spin slowed Pakistan's progress - they managed only 11 for two wickets in the first four overs when Adil Rashid and Stephen Parry combined - and with Rashid bamboozling Sohaib Maqsood with a googly and conceding just 18 in his fours overs, Pakistan had left themselves too much to do by the time Afridi strode out to the middle.
George Dobell is a senior correspondent at ESPNcricinfo