England 657 (Brook 153, Crawley 122, Pope 108, Duckett 107, Mahmood 4-235) and 264 for 7 dec (Brook 87, Root 73, Crawley 50) beat Pakistan 579 (Babar 136, Imam 121, Shafique 114, Jacks 6-161) and 268 (Shakeel 76, Anderson 4-36, Robinson 4-50) by 74 runs
Rawalipindi: England pulled off one of their greatest victories with a 74-run win over Pakistan in the first Test in Rawalpindi.
With the sun dropping at the end of a tension-filled final day, England took the last wicket with only minutes of light remaining.
In scenes reminiscent of England's famous victory in the dark in Karachi in 2000, Jack Leach trapped Naseem Shah lbw to leave Pakistan 268 all out, 75 short of their target of 343.
That England were in a position to win was thanks to James Anderson and Ollie Robinson, who gave a masterful exhibition of reverse-swing bowling to claim four wickets each.
Pakistan were defiant throughout. Saud Shakeel made 76, Mohammad Rizwan 46 and Azhar Ali 40. At 176-3 and 259-5, the home side were right in the hunt.
But after Robinson removed Salman Agha and Azhar, England could only be defeated by the fading light.
With the stadium nearly full and the crowd engrossed, 40-year-old Anderson snared Zahid Mahmood and Haris Rauf in the same over.
Naseem and Mohammad Ali survived for 52 balls, before Leach sent England into wild celebrations.
This is an England win that will be remembered for a long time, a fitting way to mark their first Test in Pakistan for 17 years.
The drama of victory being secured late on the fifth day was entirely in keeping with the extraordinary action of the previous four days.
England plundered 921 runs in 136.5 overs at a scoring rate of 6.73, the fastest of any team batting twice in Test history. The 506-4 runs they racked up on day one is a Test record.
Ben Stokes' bold declaration at tea on Sunday engineered a contest that had all four results possible going into the final session of the match.
With darkness creeping in, England looked to have missed their chance when Naseem's edge off Stokes sailed between wicketkeeper Ollie Pope and first slip Joe Root, only for Leach to provide the decisive intervention.
It ended a run of 11 away Tests without victory and secured a first win over Pakistan outside the UK for 22 years with an entire XI that had never played a Test here before.
All this after the England squad was badly affected on the eve of the match by a virus that raised the prospect of the Test being delayed by a day.
They had a stand-in wicketkeeper in Pope and an attack relying heavily on three part-time spinners, from which Liam Livingstone did not bowl because of a knee injury and will return home.
Above all, this is the finest win of England's new era under Stokes and coach Brendon McCullum, giving full vindication to their ultra-aggressive style of play that is turning Test convention on its head.