Steven Smith and Shaun Marsh scored unbeaten half-centuries to launch a strong response from Australia after Dinesh Chandimal's patient hundred pushed Sri Lanka's first-innings total to 355 on the second day of the third and final Test on Sunday.
Chandimal (132) continued Sri Lanka's superb fightback with his seventh Test century after they were reduced to 26 for five on the first morning with the hosts' innings finally coming to an end just before the tea break.
Australia, who face the very real prospect of losing their top test ranking and suffering a 3-0 series sweep, lost David Warner (11) early to Dhananjaya de Silva but Smith (61) and Marsh (64) then added 120 for the unbroken second wicket.
At stumps, the touring side reached 141 for one wicket, trailing Sri Lanka by 214 runs.
Earlier, Australia fast bowler Mitchell Starc picked up the last two wickets to fall, including the one of Chandimal, to complete his seventh career five-wicket haul and take his series tally to 22.
After resuming on 214-5, De Silva (129) and Chandimal put paid to Australia's hopes of quick wickets by extending their sixth-wicket stand to 211 before the overnight centurion became off-spinner Nathan Lyon's third victim.
Shaun Marsh, who had dropped De Silva on Saturday after the batsman had completed his maiden hundred, managed to hold on to the catch at forward short leg this time.
Dilruwan Perera (16) was the only other batsman to fall in the first session, giving left-arm spinner Jon Holland his first wicket of the innings as the batsman lofted a drive to Lyon at long on as he looked to up the tempo.
Chandimal, 26, was mostly watchful and concentrated hard during his knock but broke free to move into the 80s when he reverse swept Lyon for a superb six over the deep point boundary.
He turned Lyon for a single to square leg to complete his hundred off 281 balls, celebrating with a loud yell as he leapt in the air. He was dropped by Australia captain Steven Smith off the very next delivery.
Chandimal and Rangana Herath added 73 runs for the eighth wicket, deepening the frustration for Australia.
The partnership ended with Herath retiring hurt after suffering a body blow against paceman Josh Hazlewood.
Left-arm paceman Starc had Chandimal edging behind on the second delivery of his new spell and then dismissed Suranga Lakmal in his next over to complete his third consecutive five-wicket haul.