Resuming at the overnight score of 319/6, India were bowled out shortly after the lunch break and the hosts treaded
cautiously to keep the match on an even keel at the end of the second day's play.
Opener Kaushal Silva (51 off 117 balls) played a watchful innings to ensure that the early loss of fellow opener Dimuth Karunaratne did not trigger a top-order collapse.
Sangakkara was given a guard of honour by the Indians as he walked in to bat when the hosts lost their first wicket with just one run on the board.
Also Read
However, it did not quite turn out to be a fairytale ending for the veteran batsman, who was dismissed by off- spinner Ravichandran Ashwin for 32 after facing 87 deliveries.
After Sangakkara's departure, Lahiru Thirimanne (28 batting) and Silva added 39 runs for the third wicket before India took the slight edge by snaring the latter.
Earlier, resuming at the overnight score, India were bowled three overs after lunch as Rangana Herath took 4/81.
Wicketkeeper-batsman Wriddhiman Saha, who had scored a 60 in the first Test, played a 56-run knock to take India past the 350 figure.
The Indians scored at a slow pace in the morning session as Saha shepherded the lower order to avoid a below-par total in the first innings of this match.
The visiting side could
pull off a mere 67 runs in this first session of play in 23.4 overs.