England closed the fourth day in Colombo on 48-0 in their second innings, still 149 runs behind, after Sri Lanka had eventually declared their marathon first innings at 548-9.
Sri Lanka captain Mahela Jayawardene was dismissed for 195, one of four wickets to fall as the hosts were reduced to 450-8 just after lunch, having started the day at 379-4.
But painstaking contributions from Prasanna Jayawardene and Dilhara Fernando during a ninth-wicket stand of 98 ensured England's bowlers were made to toil until shortly after tea before the declaration came.
Opening pair Alastair Cook (19no) and Michael Vaughan (28no) then survived 13 overs in the evening to reach 48-0 when bad light brought a premature close.
The tourists, who lost the series-opener by 88 runs in Kandy, now face a survival mission on the final day to secure a draw and keep the series alive heading into the final Test at Galle.
England could have been forgiven for being a little weary after having to bowl 186.5 overs in the Colombo heat during Sri Lanka's first innings.
After 13-and-a-half-hours, Jayawardene finally put the tourists out of their misery, declaring on 548-9 early in the final session.
It had looked likely they would be off the field much sooner when they claimed four wickets during the first 28 overs of the day.
Jehan Mubarak (9) was surprised by a short ball from Steve Harmison that took the splice and looped to gully.
While Mubarak's departure was pleasing, England were delighted to see the back of Jayawardene before lunch.
The Sri Lanka skipper perished five short of a double hundred when an attempted slog-sweep at Monty Panesar (2-151) spiralled off a top edge to Paul Collingwood at slip.
It was the first real ultra-aggressive shot from Jayawardene in his patient 422-ball innings that saw him spend just 14 minutes short of 10 hours at the crease.
Stuart Broad (1-95) got rid of Chaminda Vaas (4) to claim his maiden Test wicket and, with the home side seven down and with a lead of just 88, England would have had high hopes of batting before tea.
However, those dreams died when wicketkeeper Jayawardene and Fernando produced a stubborn stand of 98 for the ninth wicket.
Making the most of a tired England attack, the pair accumlated runs at a sedate pace to extend their side's lead towards 200.
Fernando more-than doubled his Test best by finishing with 36 not out, though he owed much to Matt Prior failing to stump him off Panesar.
Jayawardene looked well set to make a second Test ton until edging an upper-cut through to Prior for 79 to become Harmison's (3-111) third scalp, a dismissal that prompted the declaration.