England need three wickets on the final day to record their first series win in Sri Lanka in 17 years after play was abandoned on Saturday due to poor light and rain with the hosts on 226 for seven and still requiring 75 runs to win and square the three-match series.
Abandoned two hours before schedule on day four at Pallekele International Stadium, the game was evenly poised at tea with Sri Lanka on 219 for five. At that stage, Sri Lanka required 80 runs with five wickets in hand, but the brief period after tea completely changed the complexion of the game.
The former captain faced 137 deliveries and hit six fours during his knock under tremendous pressure. England weren't able to create any chances off Mathews until he got out, and there was a bit of lapse of concentration as Mathews attempted to work one on the leg-side but failed to connect.
Mathews reviewed the decision to no avail.
Sri Lanka also lost Dilruwan Perera soon after that when the tail-ender yorked himself and walked off without reviewing as Jack Leach took his fourth wicket. The other three wickets to fall were shared by Ali (65 for two) and Adil Rashid (1 for 52).
Sri Lanka were ruing their luck as only 17 minutes of play was possible after tea, but during that brief period, they let England back into the game.
They had only chased 300-plus targets on three occasions, and when England set them 301, they were faced with a tall order.
Playing without Dinesh Chandimal, their best batsman and captain who is nursing a groin injury, Sri Lanka were soon in trouble, losing three wickets for 26 as Leach ran through the top order.
Mathews then was involved in two vital stands with his old school mates. He added 77 runs for the fourth wicket with Dimuth Karunaratne (57) and a further 73 runs for the fifth wicket with Roshen Silva (37).
Wicketkeeper Niroshan Dickwella then joined Mathews and smashed run a ball 23, adding 45 runs for the sixth wicket.
England won the first Test match by 211 runs in Galle earlier this month.
(With AP Inputs)