Brisbane Heat signing Shadab Khan hit a last over six to give Pakistan a sensational two-wicket win in the second Twenty20 against Sri Lanka in Abu Dhabi on Friday.
And fast bowler Faheen Ashraf derailed the Sri Lankan innings with figures of 3-16 as he became the first Pakistan player to achieve a hat-trick in Twenty20 internationals.
With Paksitan needing 12 off the final over, and eight from the last three balls, Shadab smashed Sri Lankan pacer Vikum Sanjaya for a six and then took a couple off the next delivery to help Pakistan chase down a modest 125-run target in 19.5 overs.
The win gave Pakistan an unbeatable 2-0 lead in the three-match series, with the final match in Lahore on Sunday remains of great significance as it will see Sri Lanka return to Pakistan eight years after the team was targeted in a deadly ambush in the same city in 2009.
Ashraf's hat-trick gave Pakistan eight wickets in the space of just 20 balls for 18 runs as Sri Lanka ended on 9-124 in 20 overs.
Danushka Gunathilaka top-scored with a 48-ball 51 with four boundaries and a six but Ashraf's feat stopped Sri Lanka from posting a challenge total.
Sri Lankan skipper Thisara Perera then grabbed 3-24 in his four overs to leave Pakistan in a spot of bother, removing Shoaib Malik for nine with the total at 4-55.
Skipper Sarfraz Ahmed (28) and Mohammad Hafeez (19) added 39 for the fifth wicket to bring Pakistan within 31 runs of victory.
But when Hafeez and Ahmed fell, Pakistan still needed 21 off 14 balls which Shadab made possible.
Sri Lanka had needed early wickets and they were lucky to get Fakhar Zaman (11) run out, Ahmed Shehzad (27) and Babar Azam for one.
"In that crunch situation, on this difficult pitch, that shot was a very difficult shot by Shadab," said Ahmed.
"Our youngsters are putting up big performances and Ashraf was outstanding as bowler."
Perera said his team did put up a good fight.
"As a captain, I'm really proud of them and a win was not too far away," said Perera.
"Our set batsmen need to contribute, if we take the first two batters, our plan is that they have to play till the 15th over."
It was Ashraf who sparkled in the first half.
Ashraf dismissed Isuru Udana (six), Mahela Udawatte and Dasun Shanaka off successive deliveries to become the sixth bowler to register an international T20 hat-trick.
Australia's Brett Lee was the first to achieve a hat-trick in the shortest format with his feat coming against Bangladesh at Cape Town in 2007.
New Zealand's Jacob Oram and Tim Southee and Sri Lankan duo Thisara Perera and Lasith Malinga were the others to achieve a Twenty20 hat-trick.
Sri Lanka, sent into bat for the second match in succession, got off to a solid start with openers Gunathilaka and Dilshan Munaweear put on 43 for the opening wicket.
Munaweera was dismissed for 19 before Sadeera Samarawickrama (31-ball 33) added 63 for the second wicket with Gunathilaka as Sri Lanka looked set for a 150-plus total with 1-106 in 16.1 overs.
But Sadeera, Seekkuge Prasanna and Perera were run outs before Ashraf came into his own.
This is only the second time a team has taken eight wickets in the last four overs in a T20. Pakistan did the same against Australia in the 2010 World Twenty20.