The tourists in their second innings were 311 for seven at lunch on the fourth day at Headingley today, a lead of 203 runs.
Mathews, who scored a hundred in the drawn first Test of this two-match series at Lord's, was 79 not out and Rangana Herath seven not out.
England, whatever happened now, faced a challenging total for victory on a wearing pitch.
Sri Lanka resumed on 214 for four, a lead of 106, with star batsman Mahela Jayawardene 55 not out and Mathews, who'd taken four wickets in the first innings, 24 not out.
More From This Section
England took the new ball as soon as possible, with Sri Lanka 254 for four off 80 overs.
Jayawardene was dropped on 79 when Ian Bell put down a low chance in the gully off Stuart Broad.
But the 37-year-old Jayawardene, in probably his last Test innings in England, hadn't added to his score when he drove loosely at James Anderson, the bottom hand coming off the bat handle, and was caught by wicketkeeper Matt Prior.
But that soon became 277 for seven as Plunkett, who'd taken a Test-best five for 64 on his home ground in the first innings, struck twice in two balls with the aid of catches by Yorkshire team-mates.
Dinesh Chandimal pulled Plunkett straight to Gary Ballance at deep square leg and next ball Dhammika Prasad, trying to steer over the slips, was well caught low down by Joe Root, running in from short third man.
It was Mathews who faced the next ball, after the umpires ruled the batsmen had crossed, with Plunkett on a hat-trick for the second time in the match.
Mathews then drove Plunkett for a ferocious six over mid-wicket and smashed Anderson back down the ground for four.
And in the last over before lunch Herath pulled Broad for four to give Sri Lanka a lead of more than 200.