Shoaib Malik saw Pakistan through to a dramatic three-wicket victory in the final over to break Afghanistan hearts in their first Asia Cup Super Four encounter on Friday.
A brilliant unbeaten 97 from Hashmatullah Shahidi and a rapid half-century from captain Asghar Afghan (67 from 56 balls) enabled the underdogs to post 258-7 in Abu Dhabi after winning the toss.
Pakistan were poor in the field, teenage debutant Shaheen Afridi - picked ahead of Mohammad Amir - having three catches dropped off his bowling and spilling two chances himself, but claiming figures of 2-38.
A second-wicket stand of 154 between Imam-ul-Haq (80) and Babar Azam (66) put Pakistan well on course for the win, but they needed heroics from Shoaib to get over the line.
Needing 10 off the final over from Aftab Alam, the all-rounder struck the second ball for six and followed that up with another boundary to end a gripping match with three balls to spare and finish 51 not out from just 43 balls.
Mohammad Nawaz (3-57) removed openers Ihsanullah - who was dropped twice in the same Afridi over - and Mohammad Shahzad early on to leave Afghanistan in trouble on 31-2.
Rahmat Shah (36) and Shahidi steadied the ship with a stand of 63 before the former was caught and bowled by Nawaz.
Afghan was put down by Afridi and Haris Sohail as he upped the run rate and Shahidi just missed out on a maiden international hundred, finding the ropes seven times in a mature knock.
Mujeeb Ur Rahman (2-33) trapped Fakhar Zaman leg before without scoring in the first over, but Babar and Imam took charge with a big partnership.
Imam failed to make a century when he was run out and the excellent Rashid Khan (3-46) had Babar stumped, but Shoaib drew on his experience to deny Afghanistan and leave Aftab despondent.