Rangana Herath bagged his fifth fifer against Australia - a record shared with Muttiah Muralitharan - to run through the middle and the lower order. He finished with figures of 6 for 81.
Suranga Lakmal struck the first blow for Sri Lanka, dismissing Shaun marsh and ending the 78.5-over second-wicket stand.
Shaun Marsh brought up his fourth Test ton on Monday (August 15) to help Australia put up a strong fightback. he was involved in a record 246-run stand for the second wicket with Steve Smith.
Australia's middle order crumbled against the Sri Lankan spinners and failed to take advantage of a good platform.
Steve Smith notched up his 15th Test hundred - his seventh as a captain - to put Australia in a commanding position. His knock of 119 was the highest by an Australian captain in Sri Lanka.
Mitchell Starc struck in his first over to send back nightwatchman Dilruwan Perera. Sri Lanka finished the day at 22 for 1
Mitchell Marsh struck a half century to take Australia past Sri Lanka's first innings total, and get a 24-run lead before they folded up for 279.