Sri Lanka seamer Thisara Perera claimed career-best figures of 4-63 as Pakistan was bowled out for 226 on the first day of the third and final test.
Perera polished off the top order on a lively pitch before Asad Shafiq made a gritty 75 off 158 balls with 10 fours to give Pakistan's total some respectability.
Pakistan was reeling at 4-56 before lunch, but Shafiq rebuilt the innings with an 85-run stand with captain Misbah-ul-Haq, who became Perera's fourth victim after scoring 40.
Left-arm spinner Rangana Herath had Shafiq caught behind to finish with 3-40 while Nuwan Kulasekera claimed 2-44.
Pakistan had a setback when wicketkeeper Adnan Akmal went for X-rays after being struck on the left hand by Dilhara Fernando's short-pitched delivery.
AP