Jayawardene, who received three stitches after he dropped a catch on Wednesday, scored 106 not out and shared an invaluable 139-run partnership with Silva (95) to guide Sri Lanka to 318-4 at close on the second day. (Agencies)
Sri Lanka have gained an important 153 runs lead over Pakistan's first innings score of 165 and a chance to take a lead in the three-Test series after the first match ended in a draw in Abu Dhabi last week.
Jayawardene, grimacing while playing strokes, toiled his way to a remarkable knock, hit paceman Bilawal Bhatti for his 12th boundary to reach three figure mark off 215 balls, raising his bat in delight before he was embraced by skipper Mathews.
Mathews, 42 not out, has so far added 91 for the unbroken fifth wicket stand with his illustrious partner to consolidate Sri Lanka's position.
Jayawardene, the 36-year-old former captain, has so far batted for 330 minutes for only his second century against Pakistan and his first in 21 months since his hundred against England in Colombo in April 2012.
Jayawardene-Silva ensured Sri Lanka overcome a disappointing start to the day after they lost Kumar Sangakkara (26) and Dinesh Chandimal (12) in the space of 13 runs.
Silva, who survived a confident caught behind appeal off paceman Rahat Ali when on 26, helped Jayawardene to score 83 runs in the second session without being separated, taking their team to 132-3 at tea.
Silva was finally dismissed leg-before by Mohammad Hafeez soon after tea.
He hit ten boundaries during his defiant 330-minute stay at the crease. Silva pulled off-spinner Saeed Ajmal to mid-wicket boundary to reach his second Test half-century and then had two fours off Ali to help Sri Lanka overhaul Pakistan's total.
Jayawardene, who failed in both the innings of the first Test with five and nought, successfully overturned a leg-before decision against him by Australian umpire Bruce Oxenford when on 26.
Pakistan took the second new ball in the 81st over and could have been rewarded in the next over had wicket-keeper Sarfraz Ahmed not spilled a simple chance from Mathews off Ali when the batsman had just six.
Resuming at 57-1, Sri Lanka had hoped experienced batsman Sangakkara would score more but the left-hander fell in the sixth over of the day.
Left-arm paceman Ali, who went wicketless in the first Test, trapped Sangakkara leg before Junaid, who had innings best figures of 2-75, then had Chandimal caught at deep fine-leg off an uppish hook shot.
Pakistan's bowling woes were highlighted by Ajmal's failure for a second successive innings. He went wicketless in 49 second innings overs of the first Test and once again failed to make an impact in his 27 overs.
Jayawardene, who received three stitches after he dropped a catch on Wednesday, scored 106 not out and shared an invaluable 139-run partnership with Silva (95) to guide Sri Lanka to 318-4 at close on the second day.