Phil Hughes battled his way Monday to an unbeaten test century for Australia as spinner Rangana Herath took three wickets to raise Sri Lanka's hopes of securing a series-levelling win in the third and final test.

Australia reached 209 for three at stumps on Day 4 — a lead of 52 with seven second-innings wickets in hand. Hughes carried the fight for the tourist, recording his third test hundred — the first time he has reached three figures in more than two years.

Herath returned three for 54 as Sri Lanka looked to press home the advantage of its 157-run first-innings lead, built largely around a maiden test century from Angelo Mathews.

With the pitch at Sinhalese Sports Club expected to offer spin on the final day, Sri Lanka will be hoping to take quick wickets and push for a win with the bat.

"I think the team is in a good position to win," Mathews said. "We have 90 overs tomorrow and we have to take three or four wickets in the first session."

Australia captain Michael Clarke agreed the morning session could be decisive, though he did not rule out his side pulling of an unlikely victory.

"Yes, definitely a big day tomorrow," he said. "I guess, firstly, the first session is crucial.

"There is a bit more turn out there now, certainly some reverse swing. If we can score a few runs and take a decent lead, you never know."

"In my mind, this test is certainly not over. Unfortunately, there's still a chance we could lose it if we don't bat well.

"But on the plus side, I think there's a possibility —even a minor one — that, if we can get a decent lead, a 150-run lead, there's a chance we can still win this test match."

The left-handed Hughes faced 202 balls, hitting a six and 16 fours, and added three key half-century partnerships with Shane Watson, Shaun Marsh and Ricky Ponting.

Watson fell lbw to Herath for 21, with Australia's total on 62, and the left-arm bowler also accounted for Shaun Marsh (18), in unusual circumstances.

Marsh, who made 81 in the first innings, played forward to Herath and was adjudged caught at forward short-leg. Television replays suggested the ball had missed both bat and glove -- though the batsman, surprisingly, did not ask for a review.

Ponting made 28 before edging Herath to Mahela Jayawardene at slip to leave Australia 188 for three.

Clarke joined Hughes in the middle and was eight not out at the close.

Earlier, Mathews made an unbeaten on 105 — his maiden test century — before Sri Lanka was dismissed for 473 in its first innings.

Sri Lanka resumed the day on 428-6, but lost its last four wickets for 45 runs. Mathews faced 269 balls in a restrained innings, scoring 10 boundaries.

Looking for an elusive test century having been dismissed previously for 99 and 95, Mathews was again facing the prospect of missing out as wickets fell quickly at the other end.

Passing up several singles in order to protect last man Suranga Lakmal, Mathews stepped out and hit seamer Peter Siddle past extra-cover to complete his century. He punched the air and jumped in celebration.

Siddle bowled overnight batsman Shaminda Eranga in the third over of the morning for 12 and trapped Herath lbw five overs after.

Chanaka Welegedara was run out when Mathews changed his mind after calling for a single, leaving both batsmen stranded at the same end.

Siddle returned figures of 4-91, with fellow seamers Trent Copeland and Mitchell Johnson picking up two wickets each.

Captain Tillakaratne Dilshan (83), Kumar Sangakkara (79) and Jayawardene (51) made important contributions to Sri Lanka's score in reply to Australia's first innings 316.

Australia leads the three-match series 1-0, with the second test ending in a draw.