The former captain struck a mercurial 204 not out and shared in a 216-run partnership for the unbroken sixth wicket with wicketkeeper Prasanna Jayawardene (84 not out) to help the tourists to a lead of 165 runs on the third day at the Motera.
Mahela Jayawardene took his overnight stand with Thilan Samaraweera (70) to 138 after Sri Lanka resumed the day at 275 for three, then shared in a Sri Lankan record stand for the wicket with Prasanna Jayawardene, the pair remaining unbroken over two full sessions.
Opener Tillakaratne Dilshan stroked his fifth test century of the year on the second day to set up Sri Lanka’s strong reply to India’s first-innings 426.
Centuries by Rahul Dravid (177) and skipper Mahendra Dhoni (110) helped India recover from 32 for four and post a healthy total after choosing to bat first in the three-test series.
Sri Lanka, second behind South Africa in the official test rankings, are aiming to win their first test on Indian soil since their first visit in 1982.
It was Mahela Jayawardene’s sixth score in excess of 200, his highest being 374 against South Africa in Colombo in 2006, and his second double hundred against India.
The two Jayawardenes batted out the last two sessions to put the side firmly in control of the game on a good batting pitch after the tourists lost Angelo Mathews at the stroke of lunch.
The all-rounder put on 43 with 32-year-old Mahela Jayawardene before being caught at short leg off off-spinner Harbhajan Singh, although television replays showed the ball did not hit the bat.
Samaraweera was caught at short square leg when he miscued a pull off paceman Ishant Sharma as Sri Lanka made a resolute effort to surpass India.
India’s two spinners Harbhajan and Amit Mishra were rendered ineffective as Mahela Jayawardene put the attack to the sword in a display of poise and power in his stay of eight hours.
The two spinners combined conceded 303 runs for just one wicket.
Mahela Jayawardene struck 17 fours and a six in his 339-ball knock. He reached 99 with a cut to the boundary off Mishra before punching the air in celebration after reaching his 27th test century with a single off the same bowler to point.
He hit two boundaries off left-arm spinner Yuvraj Singh to reach his 150 and also bring up the side’s 500 and got to his double century with a single to mid-off off left-arm paceman Zaheer Khan.
Scoreboard
India first innings: 426
(R. Dravid 177, M. Dhoni 110, C. Welegedara 4-87)
Sri Lanka first innings (275-3 overnight)
T. Dilshan c Dravid b Zaheer 112
T. Paranavitana c Dhoni b Ishant 35
K. Sangakkara c Tendulkar b Zaheer 31
M. Jayawardene (not out) 204
T. Samaraweera c Yuvraj b Ishant 70
A. Mathews c Gambhir b Harbhajan 17
P. Jayawardene (not out) 84
Extras (b-5, lb-13, w-3, nb-17) 38
Total (five wkts; 160 overs) 591
Fall of wickets: 1-74 2-189 3-194 4-332 5-375
To bat: D. Prasad, R. Herath, M. Muralitharan, C. Welegedara.
Bowling (to date): Zaheer 30-4-93-2 (w-2, nb-8), Ishant 28-0-108-2 (w-1, nb-3), Harbhajan 39-3-151-1, Mishra 43-6-152-0 (nb-6), Yuvraj 13-1-49-0, Tendulkar 7-0-20-0