Australia was edging towards a 2-0 series sweep over Sri Lanka after Alex Carey's breathtaking century moved the visitors into a formidable position in the second Test on Saturday.
On day three, the visitors racked up an imposing 414 before being bowled out just before lunch, securing a first-innings lead of 157 runs.
Sri Lanka lost the first test by an innings and 242 runs, also in Galle - Sri Lanka's worst defeat in test cricket
Carey was in scintillating touch, showcasing his mastery of the sweep shot to counter Sri Lanka's spin-heavy attack. As the hosts attempted to stifle the scoring by crowding the leg-side, Carey responded with audacious reverse sweeps, keeping the bowlers on the back foot.
In the process, the Australian wicketkeeper carved out a career-best 156, the highest score by an Australian glove man in Asia, eclipsing Adam Gilchrist's 144.
Steve Smith, too, made his presence felt with a well-compiled 131 - his second century of the series. However, unlike Carey's assured stroke play, Smith had a few nervous moments early on. Once settled, though, he dug in, contributing to a mammoth 259-run partnership for the fourth wicket - the highest stand at that position by a visiting team in Sri Lanka.
Sri Lanka's Prabath Jayasuriya was once again the standout bowler, claiming a five-wicket haul - the 11th of his brief yet prolific test career. Remarkably, nine of those have come in Galle, where he continues to thrive.