South Africa fell short on 286-6 despite opener Aiden Markram's 96 off 90 balls and a run-a-ball 59 by Rassie van der Dussen
Opening batsman Avishka Fernando hit an attacking 118 to set up Sri Lanka's 14-run win over South Africa in the first of three one-day internationals on Thursday.
The hosts scored 300 for nine from their 50 overs after electing to bat first in Colombo, with Fernando scoring his third ODI century.
South Africa fell short on 286-6 despite opener Aiden Markram's 96 off 90 balls and a run-a-ball 59 by Rassie van der Dussen.
"It was a very good win," Sri Lanka skipper Dasun Shanaka said. "At the end, they really came into the game, but our bowlers pulled it back."
Markram put on 106 runs for the second wicket with skipper Temba Bavuma, who retired hurt on 38, but missed out on a maiden ODI ton.
The Proteas' chase looked on track at 155-1 after 28 overs when Bavuma walked off the field due to a hand injury suffered by a throw from a Sri Lankan fielder.
South African spinner Keshav Maharaj said Bavuma was "going for a scan" and the extent of the injury will be known by Friday.
Left-arm spinner Praveen Jayawickrama soon sent Markram, who hit five fours and four sixes, trudging back to the pavilion.
Van der Dussen then put up a fight with his ninth ODI half-century as he hit six boundaries before being bowled by spinner Akila Dananjaya.
Wicketkeeper-batsman Heinrich Klaasen hit a valiant 36.
"We expected the ball to turn in second (innings) but it didn't. Spinners did well despite that," said Shanaka. "It is hard to chase on this wicket, 300 is a good total."
Fernando helped lay the foundations for a significant Sri Lankan total with several key partnerships, including a 97-run fourth-wicket stand with Charith Asalanka, who scored 72.
Maharaj returned figures of 2-30 from his 10 overs to check Sri Lanka's run rate in the middle overs.
Fernando, who put on 79 runs with Dhananjaya de Silva (44) for the third wicket, changed gears after raising his half-century and took the attack to the opposition with the left-handed Asalanka.
The 23-year-old reached his ton with a single, raising his bat and punching the air amid a standing ovation from the Sri Lankan dressing room.
Fernando, who was named man of the match, finally fell to Tabraiz Shamsi's left-arm wrist-spin, having hit 10 fours and two sixes in his 115-ball knock.
"I wasn't too pleased with my start but I was pleased with how the innings went later on," said Fernando.
Kagiso Rabada got Asalanka caught behind after the batsman's second ODI half-century in his sixth match. Rabada took two wickets.
The second ODI is on Saturday with all the matches to be played behind closed doors at the same venue.