Sehwag was on 195 when last-man Ishant Sharma joined him, but succeeded in reaching the double-hundred a few overs later with a single off spinner Muttiah Muralitharan (2-93).
He hit four sixes and 22 fours in his 231-ball knock for his fifth score of more than 200 in Test cricket, including two triple-centuries.
Sri Lanka's unorthodox spinner Ajantha Mendis (6-117) was also in the limelight as he grabbed four of the six wickets that fell in the morning to complete a maiden five-wicket haul.
Mendis, playing only his second Test, finished the innings when he trapped Sharma leg-before on the stroke of lunch.
Sehwag, 128 overnight, continued to frustrate the Sri Lankan attack despite the fall of wickets from the other end. The tourists lost their remaining wickets for 115 after resuming at 214-4.
Sehwag was the only batsman to dominate Mendis, hoisting the bowler for two sixes.He also used his feet effectively against Muralitharan to keep the Sri Lankan spin duo at bay.
Venkatsai Laxman and Sehwag were instrumental in pulling India out of trouble after the tourists had lost four wickets for 178 on Thursday. The pair added 100 for the fifth wicket.
Mendis broke the partnership when he had Laxman caught by Thilan Samaraweera at mid-wicket. The batsman added 26 to his overnight score of 13. The Sri Lankan spinner then trapped Dinesh Karthik leg-before for his fourth victim.
Mendis made a short work of the Indian tail, removing Harbhajan Singh and Sharma in quick succession.
Sri Lanka lead 1-0 in the three-match series after winning the opening Test by an innings and 239 runs in Colombo last week.