Australia were in sight of victory in the first Test after Ryan Harris picked up three wickets to reduce Sri Lanka to 120-5 by stumps while chasing a formidable 379 for victory on Friday.
With half of its side out and two days left, Sri Lanka's hopes rest on its last specialist pair of Mahela Jayawardene (57 not out) and Anjelo Mathews (32 not out), who share an unbeaten 52-run partnership.
Harris dismissed Tharanga Paranavitana lbw with the first ball of the innings and six overs later bowled captain Tillakaratne Dilshan (12). He later bowled Prasanna Jayawardene (0) to finish with 3-24.
Harris said his persistence was rewarded and his team won't be complacent despite their comfortable position.
"You can get to the ground and think it could happen pretty quickly but you also got to think they have very good players," he said.
"The two who are there at the moment are pretty set, and a couple of decent batters to come know their own conditions."
" You never obviously take it for granted. We got 270 in the first innings which is valuable and we bowled well and got ourselves in a great position, hopefully we can win tomorrow."
At 15 for two, Mahela Jayawardene and Kumar Sangakkara showed glimpses of a fight in sharing 37 runs before seamer Shane Watson dismissed Sangakkara who, unable to keep away a surprise bouncer, skied it to Mike Hussey at gully.
Thilan Samaraweera and Prasanna Jayawardene appeared to lose their wickets for being too cautious as they were dismissed without scoring. Samaraweera edged a ball from Mitchell Johnson as he tried to leave it alone and Prasanna played a forward defensive shot to an inswinger from Harris only to edge it onto the stumps.
Mahela Jayawardene and Mathews showed some positive intent, playing shots freely during their 115-ball partnership. Mahela Jayawardene has faced 139 balls and hit eight boundaries.
Sri Lanka's best successful chase was 352-9 against South Africa in 2009, and it must score 259 more runs on a pitch unfavorable for batting with plenty of time left.
Earlier, Sri Lanka spinner Rangana Herath returned career-best figures of 5-79 to help dismiss Australia for 210 in its second innings.
The left-armer bagged his fifth five-wicket haul and surpassed his previous best bowling in an innings, 5-99 against Pakistan two years ago.
Australia resumed on a rain-delayed third day on 115-6 with a comfortable 283-run lead and was helped by a useful 40-run partnership for the eighth wicket between Usman Khawaja and Harris.
Khawaja made a crucial 26 before seamer Chanaka Welegedara trapped him lbw. The last pair, Trent Copeland and Nathan Lyon, contributed 32 runs combined to lift Australia's chances.
Captain Michael Clarke topscored with 60 in the innings.
Australia scored 273 in its first innings then skittled Sri Lanka for 105.