Pace bowler Mohammad Asif claimed his second five-wicket haul of the game to give Pakistan a dominating position in the second Test against Sri Lanka in Kandy.
The tourists, having been dismissed for 170, bounced back to reduce Sri Lanka to 73-8 at the stumps as Asif (5-27) was backed up by Abdul Razzaq (3-20).
20 wickets fell on day two in a game dominated by bowlers, however, Sri Lanka's 182-run lead could be enough.
Spinner Muttiah Muralitharan was in control for the hosts with 5-39 during Pakistan's innings.
Sri Lanka kick-started the day on 267-8 but only added 12 to its score in the 3.2 overs it took Asif and Danish Kaneria to send the lower order packing with ease.
Pakistan then began its reply well as Imran Farhat and Kamran Akmal shared an opening stand of 57.
Farhat was then caught in the gully off Kulasekara for 23, yet the wicket came at a cost as Sanath Jayasuriya dislocated his right thumb in taking the catch.
Akmal soon followed when he was caught at slip off Murali for 33, before Younis Khan and Mohammad Yousuf added 50 for the third wicket either side of lunch.
However, their partnership was broken when Murali bowled Yousuf for 17, sparking an unexpected collapse which saw Pakistan's last seven wickets tumble for 49 runs in 20 overs.
Trailing by 109 on first innings, Pakistan quickly set about rectifying the situation and soon had plenty to smile about as Asif sent back Upul Tharanga (12), Kumar Sangakkara (16) and Samaraweera (four) and Razzaq removed Mahela Jayawardene (15), all of them bowled.
The destruction continued as Asif trapped Maharoof lbw for one and had Tillakaratne Dilshan caught behind for 11 in successive overs, Sri Lanka ending the day precariously poised on 73-8.