Pakistan rallied from 142-7 to chase down a target of 205 in the final over of their Under 19 World Cup semi-final against England in Dubai.
Zafar Gohar (37no) and Amad Butt (26no) shared an unbroken eighth-wicket stand of 63 to see Pakistan to a three-wicket victory and deny England their first appearance in the final of this event since 1998.
Pakistan collapsed from 57-1 to 57-4 before Saud Shakeel (45) and Ameer Hamza (35) revived their side's cause with a fifth-wicket stand of 74.
Yorkshire seamer Matthew Fisher had both caught behind to tilt the match back in England's favour, only for Gohar and Butt to provide a sting in the tail.
Jack Winslade dropped Butt on the boundary, palming the chance from spinner Rob Sayer's bowling over the rope for six to reduce Pakistan's equation to 16 required from 16 balls.
And Butt made the most of his reprieve, going on to hit the first ball of the 50th over from Winslade (0-56) through the covers for four to seal victory.
Fisher (2-21), Sayer (2-39) and leg-spinner Rob Jones (2-39) each finished with two wickets.
Half-centuries from Ryan Higgins and skipper Will Rhodes had earlier led England out of early trouble to a total of 204-7 after they chose to bat first.
England slipped to 1-2 in the fourth over of the match with both openers, Jonathan Tattersall and Harry Finch, out for ducks.
Left-arm seamer Zia-ul-Haq accounted for Tattersall and followed up with a second wicket, that of Ben Duckett (22), later in his opening spell.
Spinner Kamran Ghulam bowled Ed Barnard (13) to leave England on 69-4 but Higgins and Rhodes forged a half-century stand for the fifth wicket.
Middlesex right-hander Higgins was stumped off leg-spinner Karamat Ali's bowling for a 99-ball 52 that contained only one four.
Yorkshire's Rhodes batted throughout the remainder of the innings, hitting four fours and a six to finish unbeaten on 76 - but it wasn't quite enough in the end.
Australia take on South Africa in the second semi-final at the same venue on Wednesday. The final is next Saturday, also in Dubai.
The result means it is 16 years and counting since the only time England reached the final of this competition. On that occasion, a side containing four future Test players - Robert Key, Chris Schofield, Owais Shah and Graeme Swann - beat New Zealand by seven wickets to claim the title.