Sri Lanka, who had resumed on 14-1 after bowling India out for 249, finished the day with a slim two-run lead.
The unbeaten Sangakkara used all of his experience during a tense slow-scoring day to compile a 17th test century that spanned 226 deliveries and included 11 boundaries.
Wicket-keeper Prasanna Jayawardene was one not out when bad light stopped play.
India's bowlers battled throughout the day with Harbhajan Singh claiming two for 81 from 31.3 overs.
Left-armer Zaheer Khan, the only seamer available when Ishant Sharma limped off with a buttock injury, finished with two for 57 from 20 overs.
Khan had provided early hope for the Indians by trapping opener Michael Vandort lbw for 14 with an inswinger.
He also came close to dismissing Sangakkara without scoring, when a thick edge flew just wide of the man at gully.
However, night-watchman Chaminda Vaas (47) and Sangakkara were able to see off the early threat of the new ball and then compiled a crucial 95-run stand that formed the backbone of the Sri Lanka innings.
India, though, were left ruing a dropped chance at slip by Rahul Dravid when Sangakkara was on 34 just before lunch.
Vaas and Sangakkara extended their partnership after the interval but India's bowling improved and the run-scoring slowed.
Eventually, the pressure told when Vaas mistimed a drive to short cover, having scored his runs from 111 balls.
Harbhajan then dismissed Sri Lanka captain Mahela Jayawardene, who misjudged the length and was trapped lbw for two, a decision he appealed against unsuccessfully.
India were convinced they also had Thilan Samaraweera trapped lbw on five, Anil Kumble calling for a review when the initial appeal was turned down.
The television umpire gave Samaraweera the benefit of doubt, deciding not to overrule the original decision, visibly upsetting the India dressing room.
A couple of overs later, India's frustration mounted as Samaraweera successfully called for a review after been given out caught at short leg.
Sri Lanka weathered that difficult spell and started to score more freely just before tea.
Samaraweera and Sangakkara extended their partnership to 60 before Khan produced a beautiful leg-cutter that found the outside edge of Samaraweera (35).
Sri Lanka went back onto the defensive, inching closer to India's total with singles and occasional twos.
Tillakaratne Dilshan (23) briefly raised the tempo, cracking three boundaries, before falling in the final hour, trapped lbw to Kumble.
India are hopeful that both VVS Laxman (left ankle sprain) and Sachin Tendulkar (jarred left elbow) will be able to bat in the second innings.
The seriousness of Sharma's injury is unknown, although it appeared a major concern as he pulled up painfully in his run up and was helped off the field in the final session.
The three-match series is tied at 1-1.