The tourists slipped to 13-2 before Shan Masood and Younis Khan put on 86 for the third wicket to take the score to 99 without further loss by tea on the fourth day.
Left-handed Masood was unbeaten on 52 and Younis was on 41, with Pakistan still 278 runs away from victory on a wearing pitch at the Pallekele International Stadium.
No visiting team has scored more than 300 runs in the fourth innings to win a Test on Sri Lankan soil.
Pakistan, starting their second innings after the break, were dealt a blow before a run had been scored when seamer Suranga Lakmal bowled Ahmed Shehzad to claim his 50th Test wicket.
Sri Lanka struck again in the seventh over when Azhar Ali was caught down the leg-side by wicket-keeper Dinesh Chandimal off Dhammika Prasad for five. But Masood reached his second half-century and the experienced Younis settled into deny Sri Lanka further success.
Imran's maiden five-wicket haul saw Sri Lanka lose their last five wickets for 35 runs after they were coasting at 278-5 in the first hour of play.
Mathews, who came in to bat on Sunday afternoon with his team reduced to 35-3, anchored the innings for more than six hours in which he hit 12 boundaries and a six.
Mathews reached his fifth Test century with a flick off Rahat Ali for two runs, but not before he lost two partners off consecutive balls when he was on 99.
Next man Prasad bagged a 'king pair'-- dismissed first ball in both innings -- when he edged the next delivery from Imran to wicket-keeper Sarfraz Ahmed.
Tharindu Kaushal denied Imran a hat-trick with a defensive push and then celebrated the achievement by flicking the same bowler for a boundary in his next over.
But Imran had Kaushal (eight), Suranga Lakmal (zero) and Mathews caught behind by Sarfraz to hasten the end of the innings.
Pakistan won the first Test in Galle by 10 wickets and Sri Lanka took the second in Colombo by seven wickets.
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
