David Warner hit a blistering 144 to lead Australia's swift reply against Pakistan after Azhar Ali fell just short of a record-breaking knock on an entertaining third day in the second Test at the MCG on Wednesday.
Pakistan had declared on 443-9 with Azhar just three runs short of Viv Richards' record for the highest score by a visiting batsman in a Test match at the MCG on 205 not out.
Playing catch-up after two days of rain-interrupted play, the weather in Melbourne finally cleared as big-hitting opener Warner scored his maiden Test century at the MCG at the 10th attempt.
Warner was given a reprieve when he was clean bowled by a Wahab Riaz no-ball on 81, but he scored at just better than a run a ball to help Australia to 278-2 at stumps, 165 runs adrift.
Wahab (1-77) finally got his man late in the day after a review showed a deft edge through to wicketkeeper Sarfraz Ahmed, while Pakistan-born Usman Khawaja (95) and captain Steve Smith (10) were not out at stumps.
The first part of the day belonged to Pakistan and Azhar, however, as he wound up with the highest score by a Pakistan batsman on Australian soil.
After Mitchell Starc (1-125) tempted Mohammad Amir (29) into nicking off, Sohail Khan provided a combative partner for Azhar, who also picked up the pace on his way into the history books.
Registering just the fourth visiting double hundred in Australia, Azhar let out a primal scream after reaching the landmark, while Sohail hit six fours and four sixes for a run-a-ball 65 before he was run out by Nic Maddinson, to end an eighth-wicket stand worth 118 runs.
Despite a testing time in the field, Australia launched a magnificent counter-attack, spearheaded by Warner.
Opening partner Matt Renshaw lasted just 40 deliveries for 10, but Warner and Khawaja delivered a partnership that their big-hitting potential has often threatened.
Sohail and Amir managed to beat Warner's bat several times, but he was devastating when he did connect, reaching his fifty and passing 5,000 Test runs off consecutive Yasir balls - reaching the landmark one inning quicker than former Australia captain Ricky Ponting.
Shortly after tea, Warner faced an extraordinary spell from Wahab, who bowled three consecutive no-balls - the middle such delivery crashed into the stumps to no avail.
Warner's 17th Test hundred was brought up via his outside edge, but it did not curtail exuberant celebrations from the left-hander, whose place in the side had come under scrutiny after a near 12-month run without a hundred.
He remained under threat, though, throwing gloves at a Wahab bouncer that flew over short leg, before the left-armer finally accounted for Warner.
Smith and Khawaja were composed to the finish, the latter happy to remain in the nervous nineties overnight, despite needing just six runs when facing the final over of the day.