Usman Khawaja finally found form again to stroke a fine century Sunday and steer Australia into a massive lead over Sri Lanka as the tourists battle to stay in the second Test at Canberra.
At stumps, the visitors were 17 without loss, chasing a huge 516 to win with two days remaining after Tim Paine declared Australia's second innings at 196 for three.
Dimuth Karunaratne and Lahiru Thirimanne were both unbeaten on eight, weathering some 30 minutes before bad light stopped play slightly early.
Sri Lanka had resumed the third day at 123 for three and in a hostile morning session lost four wickets and Kusal Perera, who retired after being hit on the head by a bouncer.
Their resistence folded in the second over after lunch, with Mitchell Starc taking five wickets to leave them trailing by 319 after Australia's first innings 534 for five declared.
Paine opted against the follow-on in Australia's last Test batting opportunity before the Ashes tour to England later this year.
Khawaja padded up knowing his place in that squad was in doubt after managing a high-score of just 72 across six Tests in a lacklustre summer.
He responded in emphatic fashion, smashing his eighth Test ton off 134 balls.
It was Australia's fourth century of the match after Joe Burns, Travis Head and Kurtis Patterson reached the milestone in the first innings.
Paine declared with Khawaja on 101 and Head not out 59, following his first innings 161.
But it was far from plain sailing, with the hosts losing three early wickets.
Marcus Harris again failed, out for 14 with Kusal Mendis taking a superb diving catch at slip off Kasun Rajitha, throwing his Ashes place into question.
Mendis held another catch to dismiss Burns for nine, this time off Vishwa Fernando, and Rajitha struck again to remove Marnus Labuschagne for four.
In an incident-packed morning at Manuka Oval, the ball was handed first up to Jhye Richardson and Pat Cummins and they responded with a slew of bouncers.
Both Perera, who resumed on 11, and Dhananjaya de Silva, on one overnight, took blows to the head in the opening two overs.
Perera was then hit flush on the helmet ducking into a Richardson ball on 27.
The neck protector flew off and a Sri Lankan physio rushed to his aid. He continued and added two more runs only to call the physio again four balls later.
Once again he opted to bat on but was clearly feeling the effects and was helped off the field soon after. He stayed at the ground monitored by medics, but did not play again.
Ironically, the courageous Karunaratne replaced him after being declared fit again after being felled by a brutal bouncer on Saturday from Cummins.
He had laid prone on the ground for at least 10 minutes before being stretchered off in a neck brace, but after a hospital check was cleared of concussion and given the OK to resume his innings.
The opener returned on 46 and smacked a four to bring up his 22nd Test 50 before being caught at gully by Patterson off Starc after adding nine more.
He was out just three balls after de Silva bizarrely hit his own wicket while attempting a pull shot off Starc. As his bat swung around it took one of the bails off and he was gone for 25.
In the next over debutant Chamika Karunaratne fell Nathan Lyon and Niroshan Dickwella was out lbw to Labuschagne on the last delivery before lunch.
When they returned Dilruwan Perera and Ferndano lasted just eight more balls with Starc doing the damage, ending with 5-54 to silence his critics after a lean spell.
Australia won the first Test in Brisbane by an innings and 40 runs.