Sri Lanka, facing a stiff victory target of 352, reached 333-6 by lunch on the final day on Tuesday, needing just 19 runs more with four wickets in hand to sweep the short two-match series.
Sri Lanka thrashed South Africa by an innings and 153 runs in the first Test at the Sinhalese sports club last week.
Jayawardene, dropped by Herschelle Gibbs at gully off Andrew Hall when he was on two on Monday, showed the touch that brought him the fourth highest Test score of 374 in the first Test.
The 83-Test veteran has hit 11 boundaries and two sixes in his 16th Test century, having anchored the innings so far for five hours and 30 minutes.
Sri Lanka, who began the day needing 90 to win, had added 17 runs to their overnight total of 262-5 when Hall trapped Prasanna Jayawardene leg-before for 30.
The young wicket-keeper departed after adding 78 runs for the sixth wicket with his captain.
Farveez Maharoof escaped two chances in one over from Nicky Boje to remain unbeaten at the break on 24, having put on 54 for the seventh wicket with Jayawardene.
Maharoof missed being stumped by Mark Boucher on one and, two balls later, Hashim Amla dropped a chest-high catch at silly-point.
The tourists were handicapped by the absence of pace spearhead Makhaya Ntini due to a hamstring injury.
Ntini, who bowled 44 deliveries at half pace on Monday, did not take the field on Tuesday, leaving Shaun Pollock to share the second new ball with Dale Steyn.