Graeme Swann struck two late blows on day four to lift England's hopes of winning the second Test against Sri Lanka - though a familiar obstacle still stands in their way.
Mahela Jayawardene - who has already made two centuries in the series, including 105 in the first innings in Colombo - finished unbeaten on 55 as Sri Lanka closed proceedings on 218-6, giving them a narrow lead of 33.
But what appeared set to be a frustrating day for the tourists was given a real boost when Swann removed Thilan Samaraweera (47), putting an end to a 90-run stand, in the penultimate over of proceedings.
Nightwatchman Suraj Randiv then came and went in two deliveries, meaning England's faltering bid to retain their place at the top of the ICC Test rankings was suddenly right back on track.
They finished up taking two wickets in each of the three sessions, though it was a sign of things to come that the nightwatchman, Dhammika Prasad, would prove a major irritation in the morning.
The tail-ender had survived one James Anderson over on the third evening and frustrated England for a further 51 deliveries. He even outlasted recognised opener Lahiru Thirimanne, who edged James Anderson to Andrew Strauss to depart for 11 in the ninth over.
Prasad had his escapes, edging Swann just past wicketkeeper Matt Prior for four and then being dropped badly by Steven Finn two balls later, before his luck finally ran out on 34.
Finn made amends for his error in the field by getting the right-hander to have a hook at a bouncer, a shot that only provided a simple catch to Tim Bresnan.
The usually attack-minded Tillakaratne Dilshan opted to dig in to aid his side's survival hopes - he didn't hit a single boundary in his innings of 35.
However, his uncharacteristic knock came to an end in controversial circumstances after lunch when England successfully appealed for a bat-pad catch at slip.
Before umpire Bruce Oxenford had even got his arm fully extended the batsman called for a referral, though with no conclusive proof either way his appeal for a reprieve was rejected. The force with which he removed his gloves suggested he felt there was no bat involved before the ball looped off his pad to Anderson's hands.
The referral system was in use again three balls later when Oxenford rejected an lbw shout against Sangakkara, with the batsman surviving by the smallest of margins.
There was no doubt whatsoever, though, when the same batsman feathered an edge off Swann to Prior, Sangakkara going for a scratchy 21 to leave the home team in trouble at 125-4.
Jayawardene then nearly fell after tea when, with 20 to his name, an attempt to hit Samit Patel over the top was miscued in the direction of mid-on, but Bresnan was unable to cling on to the tough chance as he jumped backwards.
The let-off allowed the home captain to combine with Samaraweera to move their side into credit before the second new ball tilted the balance again.
No seamer was able to make a breakthrough but the extra bounce for Swann did for Samaraweera, who ended up steering the ball into his own stumps as he stepped away to play off the back foot.
Randiv was then bowled through the gate soon after and, at the end of an attritional day in tough conditions, England were suddenly in the ascendency.