Galle - Opener Dimuth Karunaratne hit an unbeaten 158 to lift Sri Lanka to 287 all out against South Africa on day one of the first Test in Galle on Thursday.

Fast bowler Kagiso Rabada claimed four wickets to reduce Sri Lanka to 176-8 but Karunaratne blasted a 222-ball knock after the hosts elected to bat first. The left-handed Karunaratne, who registered his eighth century in his 50th Test, built crucial partnerships including a 63-run 10th wicket stand with Lakshan Sandakan, who made 25.

In response South Africa were in trouble at four for one at stumps after veteran spinner Rangana Herath got Aiden Markram out for nought. Dean Elgar, on four, and nightwatchman Keshav Maharaj were at the crease at close of play on a tough day's cricket that saw rain in the afternoon and an extended final session.

The day belonged to Karunaratne who stood tall during his marathon stand after Rabada and then left-arm wrist spinner Tabraiz Shamsi tore into the Sri Lankan middle-order. "This is one of my best after New Zealand (152 in 2014) and India (141 in 2017). This is one of my top three," Karunaratne told reporters. "I want to bat till the last. It helps me to increase my average as well. That's what I want to do every time I go to bat," Karunaratne said on registering his fourth 150 plus score in Tests.

Rabada, who came back after an injury, returned figures of 4-50, while Shamsi took three wickets. Rabada had made the first breakthrough for South Africa, dismissing Danushka Gunathilaka with a delivery that rose sharply and got the batsman caught behind for 26. He then struck twice in his sixth over of the day, removing Angelo Mathews, for one, and Roshen Silva, for nought, shortly after lunch.

Those two wickets came towards the start of Sri Lanka 's middle-order, when they lost six wickets for 61 runs, slipping from a relatively comfortable 115-2. "I'd say it's probably even. The guys batted really well towards the end," said Shamsi. "But credit goes to their tail, they really hung around with the end batsmen and did the job."

But Karunaratne rarely attempted to counter attack, preferring instead to steadily build his innings, which featured 13 fours and an impressive six off Dale Steyn in the first session. South Africa skipper Faf du Plessis was forced to rotate his regular bowling options as Karunaratne played sensible cricket with the tail enders. Sri Lanka 's regular captain Dinesh Chandimal is suspended for the two-match series, after pleading guilty to breaching the spirit of cricket during the team's Test tour of West Indies last month. Suranga Lakmal is stand-in-captain.

"Although we are without our captain and coach (Chandika Hathurusingha) the team's mental state is very high," said Karunaratne. "If you look at our last Test we played without Chandimal and won in West Indies and we are still in that same frame of mind for this series," he added.

Scoreboard

SRI LANKA :

MD Gunathilaka c de Kock b Rabada 26

FDM Karunaratne not out 158

DM de Silva b Shamsi 11

BKG Mendis c Rabada b Steyn 24

AD Mathews c de Kock b Rabada 1

ARS Silva c Markram b Rabada 0

N Dickwella c Amla b Shamsi 18

MDK Perera c de Kock b Philander 1

HMRKB Herath run out 1

RAS Lakmal c de Kock b Rabada 10

PADLR Sandakan st de Kock b Shamsi 25

EXTRAS: (b 7, lb 1, nb 2, w 2) 12

TOTAL: (all out, 78.4 overs) 287

FOW: 1-44, 2-70, 3-115, 4-119, 5-119, 6-161, 7-164, 8-176, 9-224, 10-287.

BOWLING: VD Philander 8-1-28-1, DW Steyn 13-0-54-1, K Rabada 14-1-50-4, KA Maharaj 17-3-49-0, T Shamsi 25.4-2-91-3, D Elgar 1-0-7-0.

SOUTH AFRICA:

D Elgar not out 4

AK Markram c Mathews b Herath 0

KA Maharaj not out 0

EXTRAS: 0

TOTAL: (1 wkt, 4 overs) 4

FOW: 1-1.

BOWLING: HMRKB Herath 2-1-1-1, MDK Perera 2-1-3-0.

TOSS: Sri Lanka

UMPIRES: Paul Reiffel, Rod Tucker

TV UMPIRES: Nigel Llong

RESERVE UMPIRE: Ranmore Martinesz

MATCH REFEREE: Sir Richie Richardson