Centuries from Steve Smith and Shaun Marsh raised Australian hopes of avoiding a whitewash in the final Test against Sri Lanka Monday before the visitors were pegged back by their bogeyman Rangana Herath.
Smith and Marsh compiled a record 246 runs for the second wicket, putting Australia on track for a decisive lead in reply to Sri Lanka's first innings total of 355, before Herath put the brakes on with a six wicket haul.
Australia were eventually all out for 379, a lead of 24 runs which was cut to just two by close of play as Sri Lanka reached 22 at stumps, albeit with the loss of opener Dilruwan Perera who was lbw to Mitchell Starc for eight.
Dimuth Karunaratne was unbeaten on eight, alongside Kaushal Silva who has so far made six at the Sinhalese Sports Club ground in the final match of the series. Australia are trailing 0-2.
"Pretty evenly balanced at the moment, really important that we can get a few early wickets in the first session tomorrow and keep them to as low a total as possible," Shaun Marsh said at the close-of-play press conference.
Herath -- who took a hat-trick in the last Test and 10 wickets in the first match of the series -- again brought the hosts back into contention by taking six for 81.
The 38-year-old ran through the Australian tail despite struggling with a groin injury that he picked up while batting for Sri Lanka.
"He just shows so much guts and fight. And for an older guy to show that, it just ignites the fight within the younger group," said Sri Lankan coach Graham Ford.
"The example that he sets makes the coach and leadership's job all the much easier.
"He takes on the quicks and after his nasty incident comes on to bowl and makes a couple of brilliant diving stops off his own bowling. And if you have got the old man throwing like that, then yougsters have no excuses."
Herath got good support from the medium-pacer Suranga Lakmal, who struck with the second new ball in the second session to get the wicket of Marsh and break the dangerous partnership.
Marsh, who had hit his 19th boundary off the previous delivery, was bowled on 130 after he chopped Lakmal's good-length delivery onto his stumps.
Ausralian skipper Smith, who hit 10 fours and a six during his 119-run knock, departed after being stumped off Herath, with the third umpire ruling in favour of the bowler in a close decision.
Marathon stand
The marathon partnership between Smith and Marsh was the highest second-wicket stand between the two countries.
"It was hard work for sure. Really enjoyed today. Had a big partnership with the captain and obviously I am really happy," Marsh said.
The pair ensured that Australia did not lose a wicket in the first session as the visitors took lunch on 235 for one.
Marsh, who was drafted into the Australia side because of his long experience of Asian conditions, survived a dropped catch on 67 early in the morning against Herath but soon took control.
He brought up his hundred with an inside edge off Dilruwan Perera that went for a boundary and celebrated by hugging his skipper at the other end.
Smith, who resumed the day on 61, reached his 15th Test century to improve on his previous best of 55 in the series.
Mitchell Marsh, who registered his second Test half-century, contributed a useful 53 to help Australia surpass Sri Lanka's first innings score.