With the target closer to double-digits, Pakistan were not too far away from a historic Test victory in Australia but Mohammad Rizwan's controversial dismissal ended all hopes.
In the final session on day 3, Aussie captain Pat Cummins bowled a short ball that Rizwan left but as it went past, the ball seemingly brushed his glove's wristband before landing in the Australian keeper's hands.
On-ground umpire Michael Gough's original decision was not out but the Australians decided to take a DRS review.
Observing a spike on ultra-edge as the ball went past the Pakistan batter's wristband, third umpire Richard Illingworth signalled to Gough to overturn his previous call.
The hosts rejoiced but Rizwan was not pleased. He claimed rather than wristband, the ball had touched his forearm.
But to no avail. With this, Pat Cummins also claimed his 250th Test wicket.
Even social media was divided over the third umpire's call, with several Pakistani fans and experts claiming that the wicketkeeper-batter was wrongly given out.