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 Tremlett on 55.
"Our batters showed how good the wicket is," Jayawardene also told Sky Sports. "We've got the momentum now. We just need to keep pushing on."
England wicketkeeper Matt Prior, who himself made a hundred earlier on Saturday, paid tribute to Dilshan by saying: "Sometimes you take your hat off to the opposition for doing well -- and he did that.
"But we're still in a very strong position with a lot of runs on the board."
England missed a chance to separate the openers on 37 when left-hander Paranavitana, who'd then made 13, edged fast bowler Steven Finn, recalled in place of the injured James Anderson, only for third slip Alastair Cook to drop the two-handed chance.
The free-scoring Dilshan hooked Tremlett, one of England's trio of 6ft 5in plus seamers, for six and lofted off-spinner Graeme Swann into the Lord's Pavilion where the ball hit a spectator.
Dilshan later cut Finn for his 11th four to complete a 12th Test hundred in 129 balls.
Finn eventually dismissed Paranavitana's near four-hour knock when an edged drive was held by England captain Andrew Strauss at first slip.
Earlier, England were bowled out for 486 on the stroke of lunch, with Prior making 126.
Prior, together with Stuart Broad, who made an elegant 54, scored briskly during a a seventh-wicket stand of 108 in 91 balls.
England, who had slumped to 22 for three after losing the toss Friday, resumed on 342 for six.
Prior was 73 not out overnight and Broad, offering good support, 17 not out.
However, Prior went from 86 to 94 with two fortunate fours, edging seamer Suranga Lakmal just short of wicketkeeper Prasanna Jayawardene and next ball nicking him through the slips.
Prior, on 94, then saw an edged drive off left-arm seamer Chanaka Welegedara dropped by normally reliable second slip Mahela Jayawardene.
His luck held again when Prior went to 99 by edging a cut off Lakmal between keeper and first slip before a single saw him to a century off 107 balls with 17 fours.
It was Prior's second Test century at Lord's, following his 126 not out against the West Indies on his Test debut in 2007, and fifth in all.
Broad, primarily a fast-medium bowler but also a left-handed batsman, like his father Chris, the ex-England opener, was eventually lbw to Welegedara.
The persevering bowler finished with four for 122 in 28 overs having been recalled after missing the first Test.
Prior was bowled, sweeping, by left-arm spinner Rangana Herath to end an innings that saw him equal England wicketkeeper great Alan Knott's mark of five Test hundreds.
"It's something I'm very, very proud of," Prior said.
"I do keep track of records of other England wicketkeepers from the past, so it's a nice milestone."