Pakistan kept their nerve to avoid a huge shock on Saturday, beating a spirited Afghan side by three wickets with just two balls to spare to keep their World Cup semi-final hopes alive.
All-rounder Imad Wasim hit Afghanistan skipper Gulbadin Naib for a boundary through the covers to seal the win off the fourth ball of the last over, prompting a pitch invasion.
Pakistan, chasing a modest 228-run target, were in grave danger at 156 for six but man-of-the-match Imad (49 not out) and Shadab Khan (11) put on 50 for the seventh wicket to revive their hopes.
The win lifts Pakistan into fourth place in the 10-team table, above hosts England after a poor start to the tournament.
Pakistan vs Afghanistan highlights
"When I went in they were bowling brilliantly but I just hung in there," said Imad. "We wanted to bat out the 50 overs and see.
"Gulbadin (Naib) was the only one who could be targeted. They have world-class spinners so we attacked him. Thank you to the crowd, it feels like home here. They gave us a boost in confidence.
"Win our next game and we'll see what happens. Now we believe we can win from anywhere."
Pakistan were in deep trouble when their captain Sarfaraz Ahmed was run out for 18 while taking a unnecessary second run, leaving Pakistan needing 72 off the last eleven overs.
They took 18 off Naib in the 46th over, which brought the target down to a manageable 28 off four overs.
Shadhab was run out for 11 with the score on 206 but Wahab Riaz (15 not out) and Imad saw Pakistan home and condemned plucky Afghanistan to an eighth consecutive defeat.
"We fight really well, the boys gave 100 percent but in the end we missed an opportunity to win the match," said Afghanistan captain Naib. "Credit to Pakistan, they controlled their nerves.
"We missed again. You can face a lot of these situations, we are working harder and harder. The matches we have lost, we have improved."