Sri Lanka's veteran batter Angelo Mathews will wonder what could've been on day three after his wicket put the hosts in a precarious position at Galle.
The 37-year-old was pushing towards a century in the final session until he attempted to hit Nathan Lyon over the square leg boundary.
Unfortunately for the right-hander, his shot was straight into the wind and was caught by Beau Webster with Mathews departing for 76.
RECAP: Australia v Sri Lanka second Test, day three
"It's a poor option," Simon Katich said on Seven.
"You can only think the Galle heat sapped him and he's just had a brain fade because that was a strange shot."
Nathan Lyon and Angelo Mathews. Seven Network
Mathews' wicket was crucial with Sri Lanka 5-198 at the time as the veteran shared a 70-run partnership with Kusal Mendis.
From there, Sri Lanka collapsed and lost another two wickets before they were 8-211 at stumps, leading by 54 runs.
The first session of the third day ended with Australia bowled out for 414 to post a lead of 157 runs.
Once again it was an awful start for Sri Lanka, with the score 3-39.
Kamindu Mendis and Mathews combined for a partnership of 42 runs before the former played a rash shot to Usman Khawaja at mid-off.
Another partnership followed between Mathews and captain Dhananjaya de Silva but Smith was in the game, taking a screamer at slip to dismiss his opposition skipper for 23.
At 5-128 it looked like Australia would push to victory on day three but the partnership of Mathews and Kusal Mendis kept the hosts alive.
Unfortunately Mathews' brain fade came at a costly time as he became Nathan Lyon's third victim.
Ramesh Mendis was out next for a duck, becoming Beau Webster's first Test wicket when bowling off-spin.
The final batter to fall was Prabath Jayasuriya who edged a Matt Kuhnemann delivery to Smith, making it stumps as Australia push towards a series victory.
"They are very, very close to wrapping up this series," Greg Blewett said on Seven.