England's push for a historic series victory against Pakistan was blunted by an excellent partnership between Imam-ul-Haq and Saud Shakeel, before Jack Leach made a crucial late breakthrough to leave the hosts needing 157 runs to win and England needing six wickets.
Having resumed as firm favourites with a lead of 281 on day three, England ultimately set Pakistan a target of 355 to win, one that would be their second-highest successful chase if they were to pull it off. It took Brook just 20 minutes to score his second England century, reaching three figures off 137 balls with an emphatic pull for four.
However, after Pakistan broke the 101-run partnership between Brook and Ben Stokes when the England skipper holed out for 41, the hosts quickly ran through the lower order. Pakistan took the final five England wickets for just 19 runs, giving them a chance of chasing the target and levelling the series.
In response, Pakistan made an excellent start as Abdullah Shafique and Mohammad Rizwan, promoted up the order to open with Imam nursing a hamstring issue, put on an impressive 66-run partnership. However, James Anderson, finally introduced into the attack in the 16th over, produced a piece of magic to knock over Rizwan for a well-made 30.
Anderson's brilliance was quickly followed two more from Ollie Robinson and Mark Wood to remove Babar Azam and Shafique, with Pakistan falling from 66-0 to 83-3. Shafique's dismissal saw Imam make his way to the crease at number five, where he proceeded to share an 108-run stand with Shakeel as Pakistan edged closer to their target.
The pair were particularly impressive against the spinners, with Imam bring up his half-century off 80 balls and Shakeel reaching his third consecutive fifty off 114. England eventually broke the stand when Imam attempted to drive Leach out of the rough, but could only get a thick edge which was caught brilliantly by Joe Root at slip.
Shakeel and nightwatchman Faheem Ashraf were able to safely see Pakistan through to the close on 198-4, setting up what should be a fascinating fourth day's play with both sides in with a chance of recording a famous victory.
Here are five talking points...
Brook's success a welcome dilemma
Having been handed an opportunity at number five thanks to Jonny Bairstow's unfortunate leg break, Brook has well and truly made the most of it. Having smashed England's fastest ever 150 in the first Test on a flat Rawalpindi pitch, he followed it up with another excellent hundred in Multan.
While his first hundred was a brutal display of power and hitting, his second was just as impressive on a surface that has offered much more assistance for the bowlers. And his success in Pakistan creates an interesting dilemma for England when Bairstow, the hero of the summer, returns from injury.
Perhaps wicketkeeper Ben Foakes, as he has done in this Test, will be the unlucky man to miss out with Bairstow getting the gloves back. Whatever way England decide to go when Bairstow is back, it is certainly a welcome dilemma for Stokes and McCullum to have.
Stunning stat illustrates England turnaround
Remarkably, Brook's hundred was the 21st Test century scored by an England batter this year - the most they have ever recorded. It is a stunning statistic which truly illustrates the instant impact Stokes and McCullum have had given they only managed seven last year and Root was responsible for six of them.
They also ended 2021 having equalled the record for the most ducks in Test cricket in a calendar year, recording 54 and matching the tally they set in 1998. Since Stokes and McCullum have taken charge, England have taken a more positive and aggressive approach with the bat and it has paid off in remarkable fashion.
Eight different players have scored centuries so far this year and England are no longer relying almost solely on Root to score the bulk of their runs.
Anderson's enduring genius
At the age of 40, Anderson is still producing pieces of absolute brilliance for England on a regular basis and he broke Pakistan's opening partnership with one such piece of magic. After a solid start from Rizwan and Shafique, Anderson bowled a beautiful delivery in his very first over to remove Rizwan.
Anderson bowled him with a ball that just nipped past his outside edge and clattered into off stump, leaving Rizwan utterly baffled. It took the Pakistan wicketkeeper an age to leave the field such was his disbelief at Anderson's delivery.
Speaking on Sky Sports, Anderson's long-time bowling partner Stuart Broad, who is at home on paternity leave described the delivery as "the ball of the day, if not the tour, if not the year".
Robinson gets Babar again
Much like the ball that dismissed Rizwan, it took an absolute beauty from Robinson to remove Pakistan's captain. Robinson has been hugely impressive on his first tour of Asia and has now dismissed Babar twice in this Test with some brilliant deliveries.
He bowled him through the gate with an excellent wobble ball in the first innings and then bowled him again in the second innings, with Babar shouldering arms to a ball that cut back in dramatically off the pitch.
"That wobbled down, hit the seam and jagged back," former England spinner Vic Marks said on BBC Test Match Special. "Babar Azam has become Ollie Robinson's bunny. That's a huge moment in this game. Babar Azam will be having a few nightmares before we get to Karachi I think."
Imam and Shakeel's fight
Nursing a hamstring injury which forced him down the order to number five, Imam was incredibly impressive as he scored a well-made half-century in his first Test at his home ground. Shakeel was equally as good with a half-century of his own, with the pair leading the fightback after Pakistan lost three wickets in quick succession.
They pushed Pakistan closer and closer to their target and would perhaps have made them slight favourites to win had both players safely reached the close of play. However, Leach dismissed Imam for 60, thanks to a brilliant catch from Root, just 21 balls before the umpires called an end to proceedings.
And Broad believes the late wicket makes England "huge favourites" to go on and win, telling Sky Sports: "You have to stay focused and wait for that one chance and fair play to Leach and Root. The catch looks simple on TV but the ball came so quick. It gives England a huge lift. Pakistan have a chance but it's a lot of runs. I still think England are huge favourites on this pitch and with the new ball round the corner.”