Kumar Sangakkara wrote his name on the Lord's Honours Board for the first time with a brilliant century before England hit back with the ball to reduce Sri Lanka to 415-7 at stumps on day three.
Sangakkara, playing in perhaps his last Test at the Home of Cricket, struck a typically classy 147 to keep England at bay for large parts of the day, however three late wickets lifted the home side's spirits at the close.
Sri Lanka still trail England by 160 first-innings runs on a flat surface at HQ but produced a resilient batting display to comfortably avoid the follow-on in reply to their opponents' 575-9 declared.
Sangakkara once again stole the show with a classy century - his 36th in Test cricket - however his innings was perfectly complemented by half-centuries from Kaushal Silva (63), Mahela Jayawardene (55) and captain Angelo Mathews, who remains unbeaten on 79 not out.
James Anderson (2-73) picked up the solitary morning breakthrough for the hosts, getting Silva caught behind with a well-directed short ball that clipped the edge of the right-hander’s bat as he looked to take evasive action.
Matt Prior took the catch behind the stumps, meaning he and Anderson have now combined for 61 dismissals, a new record for a bowler-wicketkeeper combination for England.
Silva's dismissal merely brought Jayawardene to the middle alongside Sangakkara and the pair effortlessly put on 126 for the third wicket, making batting look easy on a slow, flat surface which nullified England's four-pronged pace attack.
Sangakkara, fresh from a hundred at the same venue in the preceding one-day series, looked in mesmeric touch and celebrated his century in style - with help from good friend Jayawardene - when dispatching Joe Root to the boundary to bring up his hundred.
As the clouds rolled in England may have hoped a change in conditions would lead to a change in fortune for the bowlers, yet any assistance in terms of swing was not really forthcoming until the arrival of the second new ball.
Jayawardene, beaten outside off stump upon its arrival, fell in Stuart Broad's comeback over when he was trapped on the crease and, despite a review, was sent back to the pavilion for 55 to give England a much-needed boost.
New man Lahiru Thirimanne looked unconvincing against the second new ball and it came as no surprise when Anderson picked him up soon after, Sam Robson claiming his first international catch with a smart grab at midwicket.
Captain Mathews and Sangakkara looked at ease and added 96 runs for the fifth wicket before Moeen Ali celebrated a notable maiden Test scalp.
Sangakkara was kicking himself all the way back to the pavilion when he chased a wide delivery from the debutant and edged through to Prior, who caught well standing up to the stumps.
Prasanna Jayawardene was treated to a short-ball barrage upon his arrival in the middle and the pressure applied from Liam Plunkett's hostile spell was rewarded when he glanced fine to leg-slip, where Ian Bell produced a sharp reflex catch.
Mathews took Sri Lanka past 400 with some crisp strokes both sides of the wicket, however England ended a tough day on a high when Chris Jordan found Nuwan Kulasekara's edge 12 balls before the close.