Dhoni struck 100 not out in India’s record 726 for nine declared in reply to Sri Lanka’s 393 as they bid for a victory that would secure their spot at the top of the test rankings.
Sri Lanka were 11 for no wicket in their second innings at the close.
Sehwag, who resumed on 284, was caught and bowled by Muttiah Muralitharan for 293 before Dhoni (100 not out), Sachin Tendulkar (53) and Vangipurappu Laxman (62) helped India record their highest test innings total.
Muralitharan, playing in his final overseas test, finished with 4-195 while his spin partner Rangana Herath took three for 240 in difficult conditions on a day when Sri Lanka were let down by poor catching.
Starting the day on 443-1 in reply to Sri Lanka’s first-innings 393, India lost Sehwag in the fourth over, much to the disappointment of an expectant and packed Brabourne Stadium.
Left-arm paceman Chanaka Welegedara struck in his first over of the day when he had overnight batsman Rahul Dravid caught behind for 74 to briefly raise Sri Lankan hopes of a revival.
COMPLETE CONTROL
However, Laxman and Tendulkar shared in a 71-run stand for the fourth wicket to pile on the agony before Nuwan Kulasekara broke the stand after lunch when Tendulkar played on.
Muralitharan had Laxman caught at mid-on and a chancy Yuvraj Singh was caught at mid-off for 23 off Herath.
Dhoni, who lashed three fours and six sixes for his second century of the series, added 111 with the last three batsmen to help India take complete control of the test.
The skipper put on 56 for the last wicket with bowler Pragyan Ojha, who remained not out on five.
Wicketkeeper-batsman Dhoni reached his third test century off 154 deliveries with a fifth six off Herath as India continued to torment Sri Lanka.
Sehwag, only the third batsman to score two triple centuries after Australia’s Don Bradman and West Indian Brian Lara, had shared in double century stands with opener Murali Vijay (87) and Dravid on the second day to put India in command.
India hold a 1-0 lead in the series after they won the second test by an innings and 144 runs. The first test ended in a draw.
SCOREBOARD
Sri Lanka first innings 393 (T. Paranavitana 53, T. Dilshan 109, A. Mathews 99, H. Singh 4-112).
India first innings (443-1 overnight)
M. Vijay lbw b Herath 87
V. Sehwag c+ACY-b Muralitharan 293
R. Dravid c P. Jayawardene b Welegedara 74
S. Tendulkar b Kulasekara 53
V. Laxman c Kulasekara b Muralitharan 62
Y. Singh c Mathews b Herath 23
M. Dhoni not out 100
H. Singh b Muralitharan 1
Z. Khan c Kulasekara b Muralitharan 7
S. Sreesanth lbw b Herath 8
P. Ojha not out 5
Extras (lb-3, nb-10) 13
Total (nine wkts decl+ADs- 163.3 overs) 726
Fall of wickets: 1-221 2-458 3-487 4-558 5-591 6-610 7-615 12
8-647 9-670
Bowling: Welegedara 30-3-131-1 (nb-6), Kulasekara 20-1-105-1, Herath 53.3-2-240-3, Muralitharan 51-4-195-4 (nb-1), Mathews 6-0-36-0 (nb-3), Dilshan 3-0-16-0
Sri Lanka second innings
T. Paranavitana not out 8
T. Dilshan not out 3
Total (no loss, 3 overs) 11
To bat: K. Sangakkara, M. Jayawardene, T. Samaraweera, A. Mathews, P. Jayawardene, N. Kulasekara, R. Herath, M. Muralitharan, C. Welegedara.
Bowling: Harbhajan 2-0-7-0, Ojha 1-0-4-0.