Off-spinner Saeed Ajmal grabbed three wickets in the morning session of the fourth day's play to leave Sri Lanka on 234-5 in their second innings, a lead of 222 runs with five wickets in hand.
The overnight pair of Jayawardene and his long-time team-mate Kumar Sangakkara, batting together for the last time in a Test match, took their partnership to 107 after Sri Lanka resumed at 177-2.
Ajmal had left-handed Sangakkara caught at silly point by Azhar Ali for 59 and then removed Jayawardene in his next over after the batsman had added five runs to his overnight score of 49.
Jayawardene mistimed a lofted shot to mid-wicket where Ahmed Shehzad took a low tumbling catch to the dismay of some 3,000 home fans at the Sinhalese Sports Club.
One run earlier, Jayawardene had survived an appeal for a catch off Wahab Riaz after replays showed the ball touch the ground before landing in wicket-keeper Sarfraz Ahmed's gloves.