Opener Sam Robson hit his maiden test century before Sri Lanka fought back with four late wickets on the second day of the second test at Headingley to leave England 320 for six at stumps with a lead of 63.
Robson (127) put on 142 with Gary Ballance (74) and 87 with Ian Bell (64) - in his 100th test appearance - but not until struggling England captain Alastair Cook had been caught behind for 17.
Australian-born Robson, 24, played patiently and looked self-assured in his second test appearance for his adopted country, reaching his century with a drive off Dhammika Prasad.
Robson's magnificent innings was eventually ended by the third ball after the drinks break when he was bowled by Nuwan Pradeep.
Sri Lanka's late burst halted England's chance of building the large first innings lead that had looked inevitable for much of the day.