Mahela Jayawardene signed off from test cricket with the bat with his fiftieth half-century as Sri Lanka were dismissed for 282 in their second innings leaving Pakistan to chase 271 for a series-leveling win in the second test on Sunday.
Sri Lanka's last five wickets added 48 runs in the afternoon session with captain Angelo Mathews remaining unbeaten on 43 when the innings ended.
Wahab Riaz finished off the Sri Lankan innings with three wickets while two batsmen were run out. The left-arm paceman struck twice in one over after lunch to remove Niroshan Dickwella (21) and Dilruwan Perera for a duck - both trapped lbw - and then bowled Rangana Herath, before the batsman had scored, to finish with figures of three for 76.
Dhammika Prasad did not last long after hitting a six and a four in his score of 19 as he was run out when Mathews tried to retain the strike and called him for a quick single. Last man Chanaka Welegedara was also run out without scoring.
Ajmal, who bowled unchanged throughout the day, finished with figures of three for 89 off 46 overs. On a pitch offering bounce and sharp turn, Sri Lanka struggled against Ajmal, who took all three wickets in the morning session.
The Pakistan attack was still without paceman Junaid Khan, who did not take the field after suffering a blow on the left side of his head on the third day against Dhammika Prasad.
The visitors picked up the experienced pair of Kumar Sangakkara and Jayawardene in the first 30 minutes of play. Sangakkara (59) had added just five to his overnight score when he pushed forward to a delivery from Ajmal that spun and bounced and took the edge to end up in the hands of Azhar Ali at silly point. Sangakkara's dismissal ended a third-wicket stand of 107 with Jayawardene, the 19th occasion the pair had been involved in a century stand.
Jayawardene (54) completed his fifty with a swept four to fine leg off Ajmal, bringing the crowd on their feet. On 53, he was lucky to survive a confident appeal for a caught behind off Wahab when the third umpire ruled in favour of the batsman after replays proved inconclusive on the authenticity of the catch held by wicketkeeper Sarfraz Ahmed.
Jayawardene, however, did not survive long as a run later he tried to hit Ajmal over midwicket but only managed to hit it in the air. Ahmed Shehzad ran back from midwicket to hold onto a good catch.
The former Sri Lanka captain received a standing ovation from the crowd all the way back to the pavilion. He ended his batting career in tests with a tally of 11,814 runs from 149 tests at an average of 49.84, making him the seventh highest run-scorer in the longest format.