Dimuth Karunaratne and Kusal Mendis collaborated in a 152-run partnership to fuel Sri Lanka's spirited reply to Australia's first-innings 364 on day two of the second test in Galle on Saturday.
Karunaratne fell for 86 in the final session but Mendis was batting on 84 at stumps with Sri Lanka on 184-2, still 180 behind.
Angelo Mathews, who was withdrawn after the first innings in the opening test for testing positive for COVID-19, was batting on six at the other end.
The hosts stumbled early in their reply when Pathum Nissanka (six) poked at a Mitchell Starc delivery and Cameron Green took a stunning catch at gully.
Mitchell Swepson could not maintain the catching standard though when Karunaratne, then on 34, drove the ball straight back to the leg-spinner.
The Sri Lanka captain, who was hit on his shoulder by a Starc delivery, otherwise looked assured, prompting Australia to waste a review trying to get him caught behind off Pat Cummins.
Swepson returned to deny Karunaratne a hundred, trapping him lbw.
Earlier, the bottom half of Australia's batting order simply caved in after they resumed on 298-5.
The tourists lost their last five wickets for 66 runs, falling well short of the 400 mark which had looked imminent when they were 329-5.
Overnight batsman Steve Smith ran out of partners and remained unbeaten on 145, which included 16 fours.
"They are still a fair way away... from our score," said Smith, sounding pleased with where Australia, who hold a 1-0 lead in the two-test series, stood in the contest.
"We got the liberty of not having to bat last as well. I think the game's in a decent spot.
"Hopefully a few early wickets tomorrow will put them under pressure."
Sri Lanka's Prabath Jayasuriya claimed 6-118 for a memorable debut test.
His are the second-best figures by a Sri Lanka bowler on test debut, after Praveen Jayawickrama's 6-92 against Bangladesh last year.
The left-arm spinner, one of the three debutants Sri Lanka fielded after five COVID-19 cases in their camp, struck two quick blows early after Australia resumed.
Alex Carey (28) perished trying to play a reverse sweep and Starc was caught in the slip in Jayasuriya's next over.
The left-arm seamer went on to trap Nathan Lyon lbw for his sixth victim.
Debutant spinner Maheesh Theeksana sent back Swepson for his first wicket in test cricket.
Thousands of protesters in Colombo stormed the president's official residence earlier in the day in the latest manifestation of public anger over the country's worst economic crisis in seven decades.
Protesters gathered at the nearby Galle fort too but Smith said they were not perturbed.
"Obviously the country is in turmoil and people are outside having their say," the batsman said.
"We could hear it and we can still hear it now but obviously it did not play a part in anything in the game."