England need another 55 runs to win the third Test in Karachi and inflict Pakistan’s first-ever men’s Test series whitewash on home soil, after Rehan Ahmed became the youngest man to take a five-wicket haul on debut at 18 years and 128 days old.

Rehan, who was held back until the fourth hour of the third day by Ben Stokes, titled the game back in England’s favour when he broke a determined fourth-wicket stand between Babar Azam and Saud Shakeel, then ran through the middle and lower order to finish with 5 for 48 in only his fourth first-class appearance.

England were set 167 to win and with a nominal 22 overs left on the third evening, they set about trying to chase the runs before the close. Zak Crawley and Ben Duckett thrashed 87 runs in 11.3 overs, Rehan was promoted to No. 3 as a “night-hawk” and Stokes threw his bat towards the square leg umpire trying to heave Nauman Ali for six, but bad light intervened with 55 more runs required.

Jack Leach had taken three wickets in the space of six balls in the morning session to remove Pakistan’s top order and after a long wait before returning to the attack, Rehan made a similar impact on the game in a five-over burst before the tea interval.

His first wicket was a freebie, Babar pulling a drag-down straight to Ollie Pope at short midwicket after bringing up his second half-century of the match. But his next two came from good balls: the second, a legbreak that gripped and found Mohammad Rizwan’s outside edge; the third, a hard-spun googly that Shakeel top-edged straight to square leg on the sweep.

Rehan returned in the evening session to polish off the lower order: Mohammad Wasim hacked him to mid-off, and Salman Ali Agha miscued a sweep to backward square leg. He sank to his knees to perform a sajdah, then beamed from ear to ear as he led the team off. His father Naeem, watching from the stands, wiped away tears as he applauded.

That led to a sprint towards the finish line, which started with Crawley skipping down and whipping the first ball through wide mid-on for four. Duckett exchanged boundaries with his opening partner as Pakistan’s shoulders slumped, and England raced to 58 for 0 after six overs.

Babar turned to his seamers, who briefly slowed the scoring, seemingly ensuring that the game would go into a fourth day, but England continued to show their attacking intent. When Crawley was trapped lbw by Abrar Ahmed, Rehan strode out – having batted at No. 8 in the first innings – and flogged his first ball down the ground for four.

He lost his off stump shortly after for a shot-a-ball 10 off 8 and despite Stokes’ best efforts alongside Duckett – who quietly racked up a 38-ball half-century, his fourth 50-plus score of the series – England fell just short of the finish line. They are unlikely to hang around on the fourth morning.

Earlier, Shan Masood had hit the first two balls of the day for four as Pakistan looked to grow their lead, but after a positive start, lost his leg stump while bottom-edging an attempted reverse-sweep off Leach.

Azhar Ali was greeted with handshakes by England’s fielders but his final innings before his retirement from international cricket was all too brief. His fourth ball was full, pitching on leg stump, but turned sharply away from the bat as he looked to whip wristily through midwicket. It crashed into the top of off stump. Azhar trudged off through a guard of honour from his team-mates.

At the start of his next over, Leach struck again, trapping Shafique lbw with a ball that skidded on off the pitch. Shakeel survived the hat-trick ball, but Pakistan were effectively 4 for 3. He dug in alongside Babar either side of the lunch break for a stand eventually worth 110 – but Rehan’s introduction half an hour before tea changed the game.