Seamer Dhammika Prasad skittled Pakistan with a four-wicket haul to put Sri Lanka on top in the second Test in Colombo on Sunday despite a defiant century from Azhar Ali.
Pakistan, who trailed by 177 runs in the first innings, were bowled out for 329 in their second knock by tea on the fourth day to leave the hosts a target of 153 runs to level the three-match series.
Pakistan won the first Test in Galle by 10 wickets.
More From This Section
Wicket-keeper Dinesh Chandimal pouched five catches and also effected a stumping, while debutant fast bowler Dushmantha Chameera claimed three wickets in an impressive Sri Lankan display at the P. Sara Oval.
Azhar was reprieved twice during his marathon vigil that lasted eight hours and 33 minutes, in which he faced 308 deliveries and hit just six boundaries.
Azhar had added four runs to his overnight score of 64 when he was dropped by a diving Kumar Sangakkara at first slip off Prasad, a catch that Chandimal could have attempted.
When he moved to 114, Azhar was saved by a television review after umpire Sundaram Ravi had declared him leg-before off Prasad.
But the Pakistan number three was stumped soon after when he tried to hit left-arm spinner Rangana Herath out of the stadium.
Pakistan, who started the day at 171-2, lost two important wickets in the morning session to go to lunch at 244-4.