Colombo: Steven Smith and Shaun Marsh hit centuries but Sri Lanka spinner Rangana Herath picked up six wickets to restrict Australia's first-innings lead to 24 runs on the third day of the third and final Test on Monday.
Captain Smith made 119 and opening batsman Marsh struck 130 as the touring side were all out for 379 in reply to Sri Lanka's total of 355.
The 38-year-old Herath continued tormenting Australia with left-arm spin, taking his series tally to 21 wickets.
The hosts, 2-0 up in the series, then lost nightwatchman Dilruwan Perera (eight) leg before to paceman Mitchell Starc as they reached 22 for one in their second innings at stumps.
Dimuth Karunaratne (eight), dropped on one by wicketkeeper Peter Nevill off Nathan Lyon, and Kaushal Silva (six) were the not out batsmen.
Resuming on 141-1, Smith and Marsh kept Sri Lanka wicketless through the morning session but both fell in the space of three overs after the new ball was taken after lunch.
The pair added 246 for the second wicket.
Marsh, playing his 18th test after a seven-month absence, was the first to get to his hundred, his fourth in tests, with a paddle sweep off Dilruwan Perera that went to the boundary.
The 33-year-old, replacing opener Joe Burns in this match, was dropped on 64 and 121. He was finally out when he chopped seamer Suranga Lakmal on to his stumps.
Smith used his feet brilliantly against the spinners and brought up his 15th test hundred with an on-driven single off Perera.
The right-hander was stumped smartly by wicketkeeper Kusal Perera off Herath who also dismissed all-rounder Moises Henriques (four) in similar fashion.
Mitchell Marsh (53) notched his second half-century in tests before becoming another of Herath's victims. Off-spinner Perera also picked up two wickets.
Scoreboard:
Sri Lanka 1st innings: 355 (D. Chandimal 132, D. de Silva 129; M. Starc 5-63)
Australia 1st innings:
D. Warner c K. Perera b D. de Silva 11
S. Marsh b Lakmal 130
S. Smith st K. Perera b Herath 119
A. Voges lbw b Herath 22
M. Henriques st K. Perera b Herath 4
M. Marsh c K. Mendis b Herath 53
P. Nevill lbw b D. Perera 14
M. Starc not out 9
N. Lyon c K. Mendis b D. Perera 3
J. Hazlewood b Herath 0
J. Holland c Mathews b Herath 1
Extras (b-4, lb-9) 13
Total (all out, 125.1 overs) 379
Fall of wickets: 1-21, 2-267, 3-275, 4-283, 5-316, 6-353, 7-367, 8-376, 9-377, 10-379
Bowling: D. Perera 44-4-129-2, D. de Silva 7-0-27-1, R. Herath 38.1-11- 81-6, L. Sandakan 19-0-70-0, S. Lakmal 13-0-54-1, A. Mathews 4-1-5-0
Sri Lanka 2nd innings:
D. Perera lbw b Starc 8
D. Karunaratne not out 8
K. Silva not out 6
Total (for 1 wickets, 5 overs) 22
Fall of wicket: 1-8
Bowling: M. Starc 3-0-19-1, N. Lyon 2-0-3-0
Umpires: Chris Gaffaney & Sundaram Ravi
TV umpire: Richard Kettleborough
Match referee: Chris Broad