Shaun Marsh and Steve Smith each hit centuries as Australia, bidding to end a disappointing series on a high, built a first-innings lead over Sri Lanka in the third Test on Monday.
Australia have already lost the three-Test series but are in a good position to claim a consolation victory after finally scoring 300, having failed to do so in the last four innings.
Marsh and Smith closed day two on scores of 64 and 61 respectively and their strong partnership was maintained on day three. Opener Marsh reaching 130 before being dismissed while captain Smith went for 119.
Rangana Herath's 6-81 quelled Australia's hopes of taking a significant lead in Colombo, with a meek performance from the middle and lower order seeing them bowled out for 379 in response to Sri Lanka's 355.
But the tourists claimed the scalp of nightwatchman Dilruwan Perera (8) before the close, as play was called for the day with the hosts trailing by two runs on 22-1.
Resuming on 141-1, Marsh and Smith picked up where they had finished day two in a magnificent stand of 246.
Marsh, whose innings featured 19 fours, brought up his fourth Test hundred when a Dilruwan Perera (2-129) delivery came off his glove as he attempted to sweep, sending the ball to fine-leg boundary.
Smith's 15th Test ton arrived less than four overs later with a well-worked single to midwicket, but his 473-ball partnership with Marsh came to an end when the latter chopped a Suranga Lakmal (1-54) delivery on to his stumps.
A superb turning ball from Herath saw Smith stumped by Kusal Perera, with Moises Henriques (4) then falling in the same fashion.
The slew of wickets continued but Mitchell Marsh (53) kept the scoreboard ticking over, enjoying particular success through the off-side on the way to a half-century that enabled Australia to move ahead.
But he found little in the way of support from the rest of the middle-order, Adam Voges (22) and Peter Nevill (14) both going cheaply to Herath and Dilruwan Perera.
Herath ended Mitchell Marsh's resistance before removing the tail with little difficulty, however, Australia were provided with further reason for hope late in the day, Sri Lanka's decision to move Dilruwan Perera up the order backfiring when he was trapped lbw by Mitchell Starc (1-19).