The opener plundered an astonishing unbeaten 284 on the second day and is 16 runs short of becoming the first player to hit three triple test centuries.
Sehwag, who has hit three of the four fastest double hundreds in tests, shared in double century partnerships with Murali Vijay (87) and Rahul Dravid (62 not out) to help India overtake Sri Lanka’s first-innings 393 on the second day.
India were 443 for one at stumps for a lead of 50 as they recorded their highest score in a day.
Sehwag, 31, tore into the bowling on a Brabourne Stadium pitch that offered bounce as he lashed 40 fours and seven sixes in a spectacular knock for his sixth score of 200 or more.
It was his 17th test century but he missed emulating Australian Don Bradman’s feat of being the only player to score a triple hundred in a day.
Sehwag reached his double hundred in 168 deliveries — New Zealand’s Nathan Astle hold the record for the fastest in 153 balls — and passed the 6,000-run mark in test cricket.
Sehwag shared in a scintillating 221-run opening wicket stand with Vijay and an unbroken 222 for the next with Dravid to dampen Sri Lanka’s hopes of recording a series-levelling victory with a first test win on Indian soil.
Vijay, playing in only his second test, had a few tentative early moments but displayed a range of shots in front of the wicket once he settled to register his maiden test fifty.
Vijay, a replacement for Gautam Gambhir after the regular opener withdrew from the test to attend his sister’s wedding, fell lbw to left-arm spinner Rangana Herath.
Sehwag, who revels in conditions that allow the ball to come on to the bat, took advantage of the bounce offered by the pitch to play some spectacular drives and cuts off the pace bowlers.
The Delhi batsman was just as brutal on master spinner Muttiah Muralitharan, striking him for a straight six and a series of boundaries as he participated in a double-century opening wicket stand for a second successive test.
Muralitharan, world record holder for most wickets in both test and one-day cricket, is playing in his last overseas test after announcing he would retire from the traditional form of the game at the end of next year.
He conceded 119 runs off 20 overs without taking a wicket.
Sehwag smashed Herath for a series of sixes and reached his century with a paddle sweep boundary off Muralitharan.
He reached his double hundred by smashing pacer Nuwan Kulasekara to the mid-on fence.
India, 92 without loss at lunch, added 351 in the final two sessions.
Earlier, Sri Lanka had lost their remaining two wickets for the addition of 27 runs in the first session with Angelo Mathews missing out on scoring his maiden test hundred by one run.
India hold a 1-0 lead in the three-match series after they won the second test by an innings and 144 runs. The first test ended in a draw.
A 2-0 win in the series will propel India to the top of the test rankings for the first time.
Scoreboard
Sri Lanka first innings (overnight 366-8)
T. Paranavitana c Dravid b Harbhajan 53
T. Dilshan c Vijay b Harbhajan 109
K. Sangakkara c Dhoni b Ojha 18
M. Jayawardene c Sehwag b Sreesanth 29
T. Samaraweera c Vijay b Harbhajan 1
A. Mathews run out 99
P. Jayawardene c Harbhajan b Ojha 43
N. Kulasekara c Dhoni b Zaheer 12
R. Herath c Dravid b Harbhajan 1
M. Muralitharan not out 4
C. Welegedara lbw b Ojha 8
Extras: (b-4, lb-6, w-2, nb-4) 16
Total: (all out+ADs- 94.4 overs) 393
Fall of wickets: 1-93 2-128 3-187 4-188 5-262 6-329 7-359 8-362 9-379 10-393
Bowling: Zaheer 19-2-70-1 (4nb, 1w), Sreesanth 16-1-82-1 (1w), Harbhajan 32-3-112-4, Ojha 23.4-1-101-3, Yuvraj 4-0-18-0
India first innings
M. Vijay lbw b Herath 87
V. Sehwag not out 284
R. Dravid not out 62
Extras: (lb-3, nb-7) 10
Total: (one wicket+ADs- 79 overs) 443
Fall of wicket: 1-221
To bat: S. Tendulkar, Y. Singh, V. Laxman, M. Dhoni, H. Singh, P. Ojha, Z. Khan, S. Sreesanth. Bowling: Welegedara 16-2-73-0 (nb-3), Kulasekara 12-0-84-0, Herath 22-2-112-1, Muralitharan 20-0-119-0 (nb-1), Mathews 6-0-36-0 (nb-3), Dilshan 3-0-16-0.