Dinesh Chandimal provided a high quality counter-attack as India require 153 more runs to win the first Test of the three-match series against Sri Lanka in Galle.
Chandimal remained unbeaten on 162 to give the tourists a fighting target on Friday as Sri Lanka were bundled out for 367 in their second innings.
Jehan Mubarak (49), Lahiru Thirimanne (44), Kumar Sangakkara (40), and Angelo Mathews (39) were the other notable contributors for the hosts.
Off-spinner Ravichandran Ashwin returned figures of 4-114 as he claimed 10 wickets in the entire match, while Amit Mishra scalped three wickets as well.
India were 23-1 at stumps on the third day, with Shikhar Dhawan (13 not out) and nightwatchman Ishant Sharma (5 not out) on the crease. The tourists lost KL Rahul in their quest for win at the score of five runs.