Kevin Pietersen’s 151 pushed England to a 181-run lead over Sri Lanka as the visitors try to tie the two-match series in Colombo.
England was all out for 460 this afternoon, with Pietersen and Ian Bell combining for 94 runs for the fourth wicket.
Rangana Herath took 6-133, including trapping Pietersen leg- before-wicket, to lead the Sri Lankan attack.
Sri Lanka was 4 for no loss at the end of the day.
England must win at the P. Sara Oval to retain the No. 1 Test ranking after losing the first Test by 75 runs.
South Africa will take the top spot should England fail to beat Sri Lanka, who are seeking their first Test series victory since August 2009.