Captain Shahid Afridi and all-rounder Anwar Ali hit whirlwind 40s as Pakistan recovered from 40-5 to stun Sri Lanka in the second Twenty20 by one wicket and take the series 2-0.
Chasing 173 after a late Sri Lanka onslaught, the tourists were left reeling by suicical running and accurate Sri Lanka bowling, losing half the side with just 40 on the board.
However, Afridi's arrival provided Pakistan some hope as he hit four sixes and a four in his 22-ball knock.
But it was Ali and Imad Wasim who first annoyed Sri Lanka, then alarmed them before finally leaving them aghast with 65 runs in the last five overs.
Ali and Wasim added 58 runs off 27 deliveries for the eighth wicket to bring Pakistan in sight of victory.
Ali weighed in with 46 off 17 deliveries including four sixes and three boundaries. He was out at 165-8 with eight balls left. Sohail Tanvir was then run out in the same over going for a second run, leaving Pakistan needing six off the last over.
Last man Mohammad Irfan hit a single off the first ball, and gave the strike to Wasim, who swatted seamer Binura Fernando's delivery over the long-on fence for a thrilling victory.
Earlier, a career-best 48 from Chamara Kapugedera and a 32-ball 40 from debutant Shehan Jayasuriya helped the hosts post a formidable total.
Sri Lanka started off the match promisingly, but quick wickets soon left them four down for 65.
Milinda Siriwardana and Kapugedera combined for 55 runs off 35 balls for the sixth wicket.
Kapugedera hit four sixes and two boundaries in 26 balls. Jayasuriya hit two sixes and three boundaries during his 32-ball innings.
Sri Lanka 172-7 in 20 overs (Kapugedera 48, Malik 2-16)
Pakistan 174-9 in 19.2 overs (Anwar 46, Fernando 2-33)
Source: Al Jazeera and agencies