Australia almost doubled their previous best total of the series against Sri Lanka on Monday, but it still wasn't enough to give them the upper hand in the third Test in Colombo.
Just before stumps on day three, the tourists were bowled out for 379 to give them a slender 24-run lead after the hosts made 355.
Australia's innings had much in common with Sri Lanka's as one massive record partnership provided the bulk of the runs at Sinhalese Sports Club.
A 246-run partnership between Shaun Marsh (130) and Steve Smith (119) lifted Australia to a dominant position but in familiar fashion for this tour, they stuttered against Sri Lanka's spinners.
At 1-267 on a wicket holding up surprisingly well after three hot days, Australia were well set to edge up towards the 500-run mark as they aim for their first Test win in the subcontinent since 2011.
However, Rangana Herath once again got the tourists in a spin as they lost 9-112 to leave the match delicately balanced.
With Australia to bat last on the parched surface, they will want to restrict Sri Lanka to 250 to have a decent chance of a consolation win.
Herath claimed 6-81 for the 25th five-wicket haul of the 38-year-old left-armer's career.
The Marsh-Smith partnership was the highest second-wicket stand for Australia in Tests against Sri Lanka and was similar to the one compiled by Dhananjaya de Silva and Dinesh Chandimal who both made top-notch hundreds to steer Sri Lanka to their solid first-innings score.
It was sparsely used paceman Suranga Lakmal who made the breakthrough, bowling Marsh when the left-hander made a late decision to leave the ball but got an inside edge onto his stumps.
Smith departed 15 balls later when he was beaten by a Herath sharp-turner, dragged his foot from his crease and was adjudged stumped following a long consultation from third umpire Richard Kettleborough.
It exposed Moises Henriques to Herath and the left-armer toyed with the recalled NSW allrounder.
Henriques got Herath's full repertoire of subtle turn, sharp turn and sliders before dismissing the 29-year-old stumped in similar fashion to Smith.
All of a sudden Australia were in familiar territory, shuffling unconvincingly to the home side's skilful spinners.
Adam Voges (22) and Mitch Marsh (53) ground away to make it to the tea, but wickets tumbled again soon after the break.
Marsh's wait for a big score goes on, the allrounder having made 25 or more in each of the four innings at No.6 in this series.
Australia's previous best series total was 203 from the first innings of the first Test in Kandy.