At stumps on the fourth day the tourists, following-on, were 381 for six in reply to England's first innings 551 for six declared - a lead of just 22 runs after bad light ended play for the day.
Tillakaratne Dilshan was 39 not out and Chamara Kapugedera unbeaten on five.
For over six hours Jayawardene defied England with an innings of 119, his 14th Test century and second at Lord's, having top-scored with 61 in his side's meagre first innings 192.
And if the forecast bad weather arrives Monday, England could yet pay even more heavily for Andrew Strauss's dropping of Jayawardene on 58.
Prior to Jayawardene's exit, England's victory hopes had been further hampered by a bad light break of nearly an hour.
But an unlucky 13 balls after the re-start Jayawardene got a thin glove off the bowling of England captain Andrew Flintoff and was well-caught down the legside by Geraint Jones, the wicket-keeper's 100th Test dismissal.
Sri Lanka were now 371 for six, only 12 ahead with four wickets standing.
Jayawardene faced 220 balls with 12 boundaries, beating the 107 he made at Lord's in a drawn Test four years ago, and sharing a stand of 68 with Dilshan.
Kapugedera, on a king pair in his debut Test, then survived a huge lbw shout first ball from Flintoff.
In the first session, England suffered a pair of self-inflicted blows, dropping two catches with Strauss putting down a routine slip chance from Jayawardene.
After lunch, debutant fast bowler Sajid Mahmood took England's first wickets of the day, the 24-year-old Lancashire paceman striking twice.
Sri Lanka had reached the interval on 258 for three with Jayawardene 70 not out and nightwatchman Farveez Maharoof unbeaten on 38 after both men had been missed behind the wicket.
Maharoof pulled luckless quick Liam Plunkett for six to go to fifty.
But Mahmood, hit for some fine boundaries by Maharoof, had him when a checked drive was caught by Kevin Pietersen in the covers.
Maharoof faced 145 balls, including seven fours, putting on 113 in 41 overs with Jayawardene.
Mahmood then had Thilan Samaraweera (six) caught behind for a return of two wickets for five runs in 13 balls.
He was in action again when Jayawardene, on 98, pushed Flintoff for a single. Mahmood's shy from mid-on missed at the bowler's stumps missed and went for four overthrows to give the 28-year-old Jayawardene his fourth Test century against England.
In the morning Maharoof, on 30, edged a drive off Flintoff with third slip Paul Collingwood just failing to hold what would have been a spectacular catch.
Next over Strauss, in the same position, put down a far easier chance to reprieve Jayawardene off the bowling of Matthew Hoggard, who on Saturday had become the tenth England player to take 200 Test wickets.
On Friday, England completed a record score against Sri Lanka after hundreds from Pietersen (158) and Marcus Trescothick (106) in what was the first of a three-Test series.