Pallekele: Shan Masood registered his maiden Test hundred while Younis Khan scores 30th ton and shared a crucial unbeaten 217-run stand to put Pakistan in a commanding position in the series-deciding third Test in Pallekele on Monday.
The tourists slipped to 13-2 before Shan Masood and Younis Khan put on 217 for the third wicket to take the score to 230 without further loss by stump on the fourth day.
Left-handed Masood was unbeaten on 114 and Younis was on 101, 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.
Earlier, Sri Lanka's captain Angelo Mathews was last man out for 122 as the hosts took their overnight score of 228-5 to 313 before they were all out at the stroke of lunch.
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 maiden Test century and the experienced Younis settled into deny Sri Lanka further success.
Pakistan's fast bowler Imran Khan, operating with the second new ball, took all the five wickets that fell in the morning session in the space of 33 balls.
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.
Chandimal was trapped leg-before by Imran for 67, ending a 117-run partnership for the sixth wicket with Mathews.
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.
Brief scores
Sri Lanka - 278 (Karunaratne 130, Yasir 5-78) and 313 (Mathews 122, Chandimal 67, Imran 5-58)
Pakistan - 215 (Sarfraz 78*, Azhar 52, Pradeep 3-29) and 230/2 (Masood 114*, Younis 101*)
Status - Pakistan require another 147 runs to win