Colombo: Phil Hughes hit timely form as Australia fought hard to wriggle out of a tight corner in the third and final Test against Sri Lanka in Colombo on Monday. (Agencies)
Hughes was unbeaten on 78 as the tourists, trailing by 157 runs on the first innings, moved to 127/2 in their second knock at tea on the fourth day at the Sinhalese Sports Club.
Michael Clarke's Australia need to bat out a major part of the last four sessions to draw the match and win the series 1-0 on the back of a 125-run victory in the first Test in Galle.
Hughes had walked to the crease in danger of losing his spot in the team after failing to score a half-century since an unbeaten 86 against New Zealand in March last year.
The left-handed opener responded with an aggressive knock that contained 11 boundaries and a six.
Hughes contributed 36 in an opening stand of 62 with Shane Watson, who fell leg-before to Rangana Herath for 21 when a TV review overturned umpire Tony Hill's decision to reprieve the batsman.
Shaun Marsh added 60 for the second wicket with Hughes when he was given out by Hill, caught at short-leg off Herath, even though replays showed the ball made no contact with the bat.
Former captain Ricky Ponting, who replaced Marsh, had yet to score.
Sri Lanka, needing a win to draw the series, gained a sizeable lead through a maiden Test century from vice-captain Angelo Mathews.
Mathews returned unbeaten on 105 as the hosts added 45 runs to their overnight score of 428-6 before they were all out for 473 shortly before lunch on the fourth day.
Fast bowler Peter Siddle claimed two of the last four Sri Lankan wickets to finish with 4-91 from 35 overs. Trent Copeland and Mitchell Johnson picked up two wickets each.
Siddle bowled Shaminda Eranga for 12 and trapped Herath leg-before for three within the first hour.
Mathews was stranded on 95 when Sri Lanka lost their ninth wicket, but the right-hander reached the coveted century by driving Siddle to the cover fence for his 10th boundary.
The 24-year-old has been one of Sri Lanka's few batting stars in the series, having made 95 in the first Test and 58 in the drawn second game.
Last man Suranga Lakmal contributed 13 in a 10th-wicket stand of 23 with Mathews before he was bowled by Johnson.
Colombo: Phil Hughes hit timely form as Australia fought hard to wriggle out of a tight corner in the third and final Test against Sri Lanka in Colombo on Monday.