Australia duly wrapped up victory over Pakistan by an innings and five runs in the first test in Brisbane on Sunday but they were forced to wait until late on day four by a magnificent rearguard action from Babar Azam and Mohammad Rizwan.
The hosts needed only seven wickets on Sunday to ensure they would take a 1-0 lead to Adelaide Oval for the second and final match of the series but Azam's second test century and 95 from Rizwan stalled their march to victory.
The pair were finally dislodged after a 132-run partnership and the Australian quicks finished the job with the second new ball, dismissing the last four batsmen for 30 runs to maintain Australia's 31-year unbeaten run at the Gabba.
"Really happy, any time you win a test by over an innings you've done a lot right," said Australia captain Tim Paine.
"Really proud of the way we started the innings and to maintain our record at the Gabba is excellent."
Josh Hazlewood took 4-63 and his fellow quick Mitchell Starc 3-73 but it was off-spinner Nathan Lyon who played the most decisive role in finishing off the tourists.
Azam showed the quality many believe will one day make him one of the world's best batsmen in superb 173-ball innings, hitting 13 fours including the confident drive that brought him to cricket's most significant milestone.
He was caught behind off Lyon for 104 half an hour before tea - a slightly quicker ball catching the outside edge of his bat and flying through to wicketkeeper Paine.
Rizwan had already secured his first test half-century and was not done yet, batting expansively as he moved towards what would have been his maiden century only to misjudge an uppercut on 95 with Lyon taking the catch at deep backward point.
Marnus Labuschagne was named Man of the Match for his knock of 185 on Saturday which, with David Warner's 154, helped Australia accumulate a first-innings tally of 580 in reply to Pakistan's 240.
"We were really pleased for a team mate like Marnus to finally arrive on the big stage," Paine added of the ebullient 25-year-old, who secured his maiden test century on his way to the tally.
"He looks like he's getting better and better, which is a good thing for Australian cricket."
Pakistan's dream of an unlikely maiden test series triumph in Australia might now be gone but their fightback on Sunday should give them renewed hope heading into the second test, a day-night affair which begins on Friday.
Captain Azhar Ali paid tribute to Azam and Rizwan as well as 16-year-old debutant pace bowler Naseem Shah, but rued the batting collapse on day one of the match.
"I think on the first day we won two sessions but we lost one very badly," he said.
"I think if you lose one session very badly it is always very hard to come back from that, especially against Australia in Australia."