The hosts, who won the toss and elected to bat on the easy-paced wicket, moved from their lunch score of 69-0 to 162-2 by tea on the opening day at the Sinhalese Sports Club.
Opener Upul Tharanga was unbeaten on 81 and Jayawardene was lucky to be still there after wicket-keeper Sarfraz Ahmed failed to hold a low catch off left-arm seamer Junaid Khan just before tea.
Kaushal Silva (41) helped Tharanga put on 79 for the first wicket when he edged Junaid to Sarfraz 20 minutes after lunch.
Pakistan's fielders lined up to greet Jayawardene, a 37-year-old veteran of 149 Tests, to the crease as firecrackers went off in the stands and some 3,000 home fans gave him a standing ovation.
More From This Section
The SSC, which has been Jayawardene's home ground since his early days, was decorated with giant posters of the star batsman, many of them highlighting his career-best score of 374 at the same venue in 2006.
Left-handed Tharanga survived a difficult stumping chance when he was on 24 as a ball from spinner Saeed Ajmal rose alarmingly and struck the wicket-keeper on the left ear.
Pakistan's bowlers toiled manfully in unhelpful conditions to restrict the scoring rate with Junaid looking the most dangerous with one for 41 from 14 overs.
Sri Lanka made two changes from the side that won the first Test to take the lead in the two-match series.
Pakistan left out lanky fast bowler Mohammad Talha to play Riaz.