Pakistan captain Azhar Ali kept England at bay with an unbeaten 82 in the third Test at Southampton on Sunday.
At tea on the third day Pakistan were 158-5 — still a huge 425 runs behind England's mammoth first innings 583-8 declared.
But Azhar, who had only managed 38 runs in three previous innings this series, was in sight of a hundred, having become just the fifth Pakistan batsman to have scored 6,000 Test runs.
Together with wicketkeeper Mohammad Rizwan (22 not out) he had shared an unbroken stand of 83 after Pakistan had collapsed to 75-5.
Anderson eyes 600 wickets
The duo also halted England great James Anderson's charge towards becoming the first paceman to take 600 Test wickets.
It looked like the 38-year-old was well on his way with superb lunch figures of 4-21 from 11 overs taking him to 597 Test wickets and leaving Pakistan in the dire position of 41-4.
But Pakistan fought back by scoring 117 runs for the loss of just Fawad Alam in Sunday's second session.
The 35-year-old Azhar, in his 81st match at this level, joined an elite Pakistan group featuring Younis Khan, the current batting coach, Javed Miandad, Inzamam-ul-Haq and Mohammad Yousuf to have reached the milestone of 6,000 Test runs.
England, pressing for their first series win over Pakistan in a decade at 1-0 up in a three-match campaign, resumed in total command with the tourists 24-3.
Anderson needed just six balls on Sunday to remove Asad Shafiq, the batsman's poor series continuing when, on five, he limply edged to England captain Joe Root at first slip.
The only bowlers to have taken 600 wickets in Tests are three retired spinners — Sri Lanka's Muttiah Muralitharan (800), Australia's Shane Warne (708) and India's Anil Kumble (619).
England thought they had Azhar, on 21, caught behind off a fearsome 91mph ball from fast bowler Jofra Archer that rose steeply.
But umpire Richard Illingworth's not out decision was upheld when a challenge revealed the ball had brushed Azhar's shoulder — a move that meant England had used up all three of their reviews in the innings.
There was no need for technology when Alam, whose near 11-year wait for a Test recall ended with a four-ball duck in the drawn second Test at Southampton, fell for 21.
The left-hander, a distinctive figure at the crease thanks to his wide open stance, lunged forward to off-spinner Dom Bess, with wicketkeeper Jos Buttler holding a good catch off the shoulder of the bat.
It was a heartening wicket for Bess in a season where conditions had favoured seam bowlers and a much needed dismissal for Buttler, fresh from his 152 in England's first innings, after some sub-standard displays behind the stumps.
Pakistan were now 75-5 but Azhar clipped Archer off his pads for four to go to 6,000 Test runs and a similar boundary saw the under-pressure skipper to a 137-ball fifty.
Both fours were applauded by Azhar's teammates in the Pakistan dressing room, with this match, as has been the case with all internationals in England this season, being played behind closed doors because of the coronavirus.
England's imposing total was built on a fifth-wicket partnership of 359 between Zak Crawley and Buttler, whose hundred was just his second century in 47 Tests.
Crawley's 267 — the 22-year-old's maiden Test century — was the tenth highest score by an England batsman at this level.