Michael Clarke posted his first century as Australia captain to ensure the third and final Test against Sri Lanka ended in a series-clinching draw.
The stalemate secures a 1-0 series win for Australia, who have been led by Clarke away from home for the first time.
Clarke made 112 as the tourists, trailing by 157 runs after the first innings, piled up 488 in their second knock, leaving Sri Lanka an unattainable target of 332 to win in just over an hour.
Left-arm spinner Rangana Herath recorded career-best figures of 7-157 - moving to 100 Test wickets in the process - however his efforts ultimately proved futile for Sri Lanka, who have now failed to win any of their last five Test series.
Australia, who claimed a 125-run victory in the first Test in Galle, resumed the final day on 209-3 thanks to a first century of the series from Phil Hughes.
However the Aussie left-hander had helped add just 11 runs to their overnight score when he top-edged a sweep off Herath to Lahiru Thirimanne at square-leg.
Herath, who had claimed three wickets the previous day, shared the second new ball which was taken in the 87th over with the total 268-4.
Clarke responded to the gamble by driving the spinner through the covers and lofting the next ball for six to bring up his half-century.
Clarke, who survived a missed stumping when on 71, reached his first Test century since March 2010 by pulling Herath through mid-on for his 14th boundary, soon after he had smashed the bowler for his third six.
The right-hander lost concentration following a brief verbal exchange with Sri Lanka's Kumar Sangakkara though, and holed out in the deep to give Herath his fifth wicket of the innings.
Left-hander Michael Hussey continued his remarkable form, however he fell seven runs short of making centuries in each innings for the first time in his career when he top edged Tillakaratne Dilshan to Chanaka Welegedara at square-leg.
Herath added Brad Haddin (30) and Peter Siddle (26) to his list of scalps before the inevitable draw was confirmed just two overs into Sri Lanka's second innings, where they had reached 7-0.