Pakistan fell agonisingly short of an historic first-Test victory as Australia survived an almighty scare to triumph by just 39 runs on the fifth and final day in Brisbane.
Chasing a mammoth and world record fourth-innings target of 490 at the Gabba on Monday, Pakistan's stubborn rear-guard was finally broken as Steve Smith produced an incredible direct hit to run out Yasir Shah (33) and dismiss the spirited tourists for 450.
Centurion and man-of-the-match Asad Shafiq (137) was impenetrable until he departed four deliveries earlier and once he returned to the pavilion to a standing ovation, there was only ever going to be one victor in the first of three Tests.
The odds were firmly stacked against Pakistan, who resumed on 382-8, however the Australians appeared visibly frustrated as the Pakistanis produced an admirable performance, Shafiq leading the way as the impossible became the seemingly possible with every passing ball and run.
Mitchell Starc (4-119), Josh Hazlewood (0-99), Jackson Bird (3-110) and Nathan Lyon (2-108) toiled tirelessly without reward, with Shafiq and Yasir Shah continuing to find the gaps in the field as the total slowly went from 100 runs to 50.
Whatever the Aussies threw at Shafiq and Shah, the stubborn duo responded, combining for an inspirational 71-run ninth-wicket stand before the former fell victim to the pace and bounce of Starc.
A short delivery pitched outside off stump saw Shafiq come unstuck as the star Pakistani skied a ball into the air and straight to David Warner at gully in the 145th over.
That is all the Australians needed, with Smith - who dropped two catches on Sunday - reacting quick to hit the stumps from slips after Yasir strayed away from his crease in a lackadaisical end to the game as the series moves to Melbourne for the Boxing Day Test.