Sri Lanka beat Pakistan by seven wickets on the fifth and final day to win the second Test played at the P Sara Oval and level the three-match series 1-all.
Pakistan won the first Test at Galle by ten wickets.
The third and final Test will be played at Pallakele starting on July 3.
Scores: Pakistan 138 and 329;
Sri Lanka 315 and 153-3 (Dimuth Karunaratne 50, Kithuruwan Vithanage 34, Angelo Mathews 43 not out, Yasir Shah 2/55)