Dimuth Karunaratne refused to throw in the towel on Sunday and struck his sixth test century to lead Sri Lanka's fight back against India on day four of the second test.
Subjected to the follow-on after their first innings debacle, Sri Lanka's second innings resurgence was built around the 191-run stand between Karunaratne and Kusal Mendis, who fell for 110 on Saturday.
Karunaratne was batting on 136 at lunch on the penultimate day with Sri Lanka on 302-4, still 137 runs behind.
The left-hander has raised 61 runs for the flourishing fifth wicket with former skipper Angelo Mathews, who was on 28 at the Sinhalese Sports Cricket Ground.
Karunaratne's defiant knock, his fourth second innings century and first against India, included 16 boundaries.
The ball spun alarmingly and occasionally kicked off but India's poor catching meant the tourists, bidding to take an unassailable 2-0 lead in the three-test series, had to wait 12 overs for a breakthrough after Sri Lanka resumed on 209-2.
Skipper Virat Kohli, who had spilled Mathews in the first innings, missed an opportunity to catch Malinda Pushpakumara at gully, while KL Rahul grassed Karunaratne at short leg with Ravindra Jadeja being the unlucky bowler on both occasions.
Ravichandran Ashwin finally separated the batsmen when nightwatchman Pushpakumara went for a bizarre reverse slog, only to have his stump pegged back.
Jadeja struck in the next over when he had Sri Lanka skipper Dinesh Chandimal caught in the slip for two.
Mathews clobbered a couple of sixes and often took a long stride forward to meet the pitch of the ball to negate the Indian spinners, especially Jadeja.