Mahela Jayawardene smashed an unbeaten 140 as Sri Lanka regrouped after early strikes to post 305-5 on the first day of the series-deciding second Test against South Africa Thursday.

Jayawardene, 37, hit 16 fours and a six in his nearly six-hour stay at the wicket to pull up Sri Lanka from a shaky 16-2 after the hosts opted to bat on a docile track at the SSC ground.

This was Jayawardene's 11th century at the ground, the most by any batsman at a single venue. He also joined India's Sunil Gavaskar and Brian Lara of the West Indies at tied fifth on the list of highest Test century makers.

The stylish right-hander, due to retire from Test cricket next month, shared 99 runs with opener Kaushal Silva (44) and another 133 runs with skipper Angelo Mathews (63) for the fourth wicket.

Mathews, who promoted himself up the batting order, played patiently before nicking to wicketkeeper Quinton de Kock off part-time spinner Jean-Paul Duminy shortly into the final session.

Kithuruwan Vithanage, playing his fifth Test and first against South Africa, was peppered with short balls by the quicks until his misery was ended by seamer Morne Morkel (1-42) who had him caught by AB de Villiers for 13.

Test debutant Niroshan Dickwella, batting on 12 at stumps, was given out caught off Duminy but the decision was revoked on review with TV replays showing the ball had hit only his pads.

The first session though belonged to fast bowler Dale Steyn, the star of South Africa's big win in the first Test at Galle.

Steyn (2-55) sent back opener Upul Tharanga and big-hitter Kumar Sangakkara for a golden duck in his sharp four-over opening spell.

Duminy (2-58) accounted for the third wicket to fall in the morning, dismissing Silva for a well-made 44 off 73 balls.

Tharanga started off confidently, driving Steyn to the cover boundary in the first over of the day and smashing Vernon Philander straight down the ground for another four.

But Tharanga's flourish was short-lived as he gloved to De Kock off the fifth ball of Steyn's third over.

Steyn struck again off the very next ball to dismiss Sangakkara, much to the disappointment of home fans.

The prolific left-hander tried to pull a short delivery, but succeeded only in top-edging it tamely to square leg where Imran Tahir took an easy catch.

Sri Lanka would have been in deeper trouble but Alviro Petersen dropped Silva on 10, failing to judge which way the ball was going while fielding in the slips, with Philander being the unlucky bowler.

Jayawardene, playing at his home ground, displayed sublime form, once hitting Steyn for two fours in an over and lofting Tahir over the mid-off for a huge six.

He hugged Mathews on reaching the three-figure mark and waved to the fans while firecrackers were set off near the stands.