Jayawardene, due to quit Test cricket next month, hit 17 fours and a six during his nearly eight-hour stay at the wicket, laying down the foundation for a strong first innings total.
At lunch, Sri Lanka were 395-6 with Test debutant Niroshan Dickwella batting on 63 and Dilruwan Perera on nine.
Jayawardene, who was run out by a direct hit from Alviro Petersen about 30 minutes from lunch, shared a rollicking 100-run stand with Dickwella who showed a lot of promise in his 103-ball knock.
Jayawardene too picked up the pace, reaching the 150-run mark with a single to long leg off Dale Steyn.
More From This Section
The South African quicks struggled to make the new ball count in the crucial first hour, regularly pitching in loose balls that were promptly dispatched to the fence.
Morne Morkel's short balls were hit for two fours on the trot by Dickwella, the batsman arching back slightly and ramping the second one high over the slip cordon.
The Proteas, apparently frustrated at their lack of success, sought a review when Dickwella was on 44 but TV replays showed the ball had only hit his chest before being caught in the slips.
Unruffled, Dickwella went on to complete his debut Test fifty with three runs off a full toss from Morkel that he nudged it to the mid-on region.
With the fast bowlers failing to make a dent, new Test skipper Hashim Amla brought on the spinners but without luck.
The hosts added 90 runs in the session while losing the wicket of Jayawardene.
South Africa lead the two-Test series 1-0 after winning the first match in Galle by 153 runs.