Sri Lanka in their second innings were 426 for eight -- the highest total of the match -- at tea on the fourth day, a lead of 318 runs.
Mathews was 149 not out, having made 102 in the drawn first Test of this two-match series at Lord's.
Importantly, he received superb support from Rangana Herath (48) in an eighth-wicket stand of 149.
The pair were only separated on the stroke of tea when Mathews set off for a single in search of 150, stopped and sent non-striker Herath back only for the left-arm spinner to be run out by Joe Root's direct hit from mid-on.
More From This Section
Sri Lanka resumed Monday on 214 for four, a lead of 106, with star batsman Mahela Jayawardene 55 not out and Mathews 24 not out.
The pair, against less than attacking fields, cashed in by scoring 40 runs in seven overs before England took the new ball.
Jayawardene had moved on to 79 when Ian Bell dropped a low chance in the gully off Stuart Broad.
Sri Lanka were now 268 for five.
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.
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 by Joe Root, running in from short third man.