Australia started the third day well on Saturday moving from 6-342 at the beginning to end up making 9(dec)-432 with Peter Siddle (38) and Jackson Bird (6 not out) giving Matthew Wade good support on his way to 102 not out as he notched his second Test century.
That gave the Australians a lead of 138 on the first innings and even though Sri Lanka lost opener Tillakaratne Dilshan for five just after lunch, 24-year-old youngster Dimuth Karunaratne and 34-year-old captain Mahela Jayawardene looked terrific surviving right until tea.
They got Sri Lanka to 1-132 and just six behind Australia's total before being able to get in front, and set the home side a challenging run chase.
However, once Karunaratne fell just after tea for a well-made 85 the rot began to set in.
Despite not being able to cash in for his maiden Test century in just his fourth five-day match for his country, it was a knock of the future for Sri Lankan cricket from Karunaratne.
The left-hander reached his highest score in international cricket and showed he can be a long-term key batsman, particularly once Dilshan, Jayawardene and Kumar Sangakkara retire.
However, once he was out for 85 from 109 balls when Jackson Bird had him out caught behind, Sri Lanka then only just got in front of Australia before first innings top-scorer Lahiru Thirimanne made just seven before Bird caught him out off Mitchell Johnson.
Jayawardene was watching this happen from the other end, but he had every reason to be livid at veteran Thilan Samaraweera just an over later when he attempted a ridiculous shot off Nathan Lyon and only managed to hit it up in the air where the retiring Michael Hussey took a good catch.
Sri Lanka was then struggling at 4-158 with a lead of just 19 and while the captain was there with the man set to replace him Angelo Mathews, when the pair had a horror mix up and Mathews was run out for 16, Sri Lanka's hopes of setting Australia a big chase seemed to go with it.
Jayawardene then fell the very next over when he was caught by Michael Clarke off Peter Siddle for a well-made 60 in what is to be his last match as captain of Sri Lanka, and his final Test innings in Australia of his career.
Wicket-keeper Dinesh Chandimal and Dhammika Prasad put on another 24 before Prasad was caught behind off Mitchell Starc for 15. Chandimal remained 22 not out at stumps and Rangana Herath was seven, but Sri Lanka has a lead of only 87 with just three wickets remaining.
Johnson has claimed 2-19 for Australia with Starc, Bird, Siddle and Lyon all picking up a wicket apiece.