At stumps, Sri Lanka were 231 for one, 255 runs behind England's first innings 486.
Dilshan, who picked up a thumb injury that required a post-play scan, was 127 not out after sharing a record-breaking first-wicket partnership of 207 with left-hander Tharanga Paranavitana (65).
This was Sri Lanka's first century opening stand in a Test in England and the best for any first wicket in England-Sri Lanka Tests, surpassing the 168 shared by England's Marcus Trescothick and Michael Vaughan in 2002 on another typically good Lord's pitch.
Former Sri Lanka captain Kumar Sangakkara was unbeaten on 13 at the close.
It was all a far cry from Monday's collapse in Cardiff where Sri Lanka were dismissed for just 82 as England won the first Test by an innings and 14 runs to go 1-0 up in the three-match series.
"He's in a bit of pain but the way he batted I don't think it's serious damage," Sri Lanka's Mahela Jayawardene said of Dilshan's injury, sustained when he was hit by fast bowler Chris Tre