Nathan Lyon bagged four wickets in the day even as Sri Lanka stretched their lead to 288 runs.
Dinesh Chandimal and Kaushal Silva added the highest partnership of the Sri Lankan innings, putting up 90 runs for the sixth wicket. The stand put Sri Lanka in command of the match that stood in balance for most periods.
Kaushal Silva, who had his webbing split, showed immense resolve on way to his third Test century.
Australia struck early in the day after Peter Nevill cleverly stumped Dimuth Karunaratne.
Angelo Mathews stabilised the Sri Lankan innings, along with Kaushal Silva. However, for the second time in the match, he fell while playing a sweep shot to Nathan Lyon.
Kusal Perera played a brief entertaining knock, displaying fine reverse sweeps. But eventually he was declared out by the third umpire in controversial circumstances.
When Kaushal Silva was running out of partners, Dinesh Chandimal (above) offered a crucial hand and struck 43 runs before being trapped leg before wicket.