Adelaide - Pakistan was battling to stave off defeat in the day-night second Test against a relentless Australia on Sunday after being forced to follow on, with Tim Paine's men needing seven wickets to clinch the series 2-0.
The visitors, who have lost 13 consecutive Tests in Australia, were in big trouble at 39 for three when rain forced an early end, 248 runs behind with two days left and their top order decimated.
They had resumed on an overcast and cold afternoon teetering at 96 for six in their first innings, in reply to Australia's 589 for three declared, built on the back of David Warner's monumental 335 not out.
Yasir Shah smacked a dogged maiden Test century and Babar Azam hit 97 but they were all out for 302 and still 287 runs adrift.
Mitchell Starc was the hero, taking 6-66, but he put Australia's commanding position down to greater consistency within the team.
"The first two Test matches, the huge partnerships we've had, the individual scores. We've talked a lot about big first innings totals and the guys have really responded," he said.
"We've been fantastic in bowling partnerships as well. Pakistan have had a couple of positive innings individually, but probably haven't had that consistency."
Australian skipper Tim Paine enforced the follow on and it started badly for Pakistan, whose first task was to survive intact for 15 minutes before the dinner break.
They failed with opener Imam-ul-Haq - recalled after being overlooked for the first Test in Brisbane, which they lost by an innings and five runs - out lbw for a duck to Josh Hazlewood.
It was quickly 11 for two with Starc tempting skipper Azhar Ali into a thick outside edge and Steve Smith taking a quality catch just seconds before rain forced them off.
Showers had been threatening all day and when they returned after 30 minutes Hazlewood bagged the key wicket of dangerman Azam for two, caught behind by Paine.
But more rain soon blew in, to Australia's frustration, and the umpires called it a day.
Earlier, Yasir and Azam had kept Pakistan's slim hopes alive with disciplined first innings batting.
Better known as a spin bowler, Yasir had never gone better than 42 in his previous 36 Tests, making his 113 against one of the world's most fearsome pace attacks even more remarkable.
"It is a dream come true for any batsman to score 100 against Australia. I was very excited," said Yasir.
"I've never got a hundred before, anywhere, so I felt a little bit of pressure on 99."
In a scintillating spell under lights on Sunday night, left-armer Starc snapped up four quick wickets and the omens for Pakistan did not look good.
But the gloomy conditions at Adelaide Oval offered little for the bowlers during daylight hours on Sunday and Azam and Yasir took advantage.
They put on a 105-run stand and Azam looked destined for a third Test century until Starc pounced again, with the 25-year-old edging an attempted drive to Paine behind the stumps on 97.
Azam - who scored a century in the first Test at Brisbane and is rapidly emerging as his country's top batsman - left the field dejected but to a standing ovation.
The very next ball Starc grabbed his sixth, with Shaheen Afridi plumb lbw before Mohammad Abbas fended off the hat-trick ball.
Abbas made a gutsy 29 before he was undone by a Pat Cummins bouncer, caught at gully by Warner.
At the other end, Yasir showed composure to compile his first-ever ton, bringing up the milestone off 192 balls, clattering 12 fours and kissing the turf in celebration.
He was finally out hooking a Cummins delivery to Nathan Lyon.