Faf Du Plessis' knock of 88 runs propelled South Africa to 338 runs in the allotted fifty overs for the loss of seven wickets.
Cardiff: South Africa defeated Sri Lanka by 87 runs on Friday in a warm-up fixture at Cardiff ahead of the upcoming Cricket World Cup.
Chasing a score of 339, Sri Lanka got off to a bad start as they lost Kusal Perera (0) and Lahiru Thirimanne (10) in quick succession and they were reduced to 10 for two.
Dimuth Karunaratne and Kusal Mendis put up a 62-run stand, but their resistance was broken by Andile Phehlukwayo in the 14th over as he dismissed Mendis (37).
Angelo Mathews and Karunaratne steadied the ship for the Islanders as they stitched together a 98-run stand. Their partnership was finally broken by Kagiso Rabada as he took the crucial wicket of Karunaratne (87).
Dhananjaya de Silva (5) also failed to leave an impression as he was sent back to the pavilion by Phehlukwayo with the team still requiring 140 runs for the win.
Mathews (64) also perished in the 39th over and with his dismissal, Sri Lanka's hopes of winning the match ended and they finally lost the match by 87 runs.
Earlier, skipper Faf Du Plessis' knock of 88 runs propelled South Africa to 338 runs in the allotted fifty overs for the loss of seven wickets after being asked to bat first.
The Proteas got off to a quickfire start as the openers Aiden Markram and Hashim Amla scored 47 runs in the opening 6.2 overs. Sri Lanka got the first breakthrough as Suranga Lakmal sent Markram (21) back to the pavilion.
Amla and Du Plessis piled on the misery on the Islanders as they stitched together a partnership of 128 runs. Amla (65) and Du Plessis (88) were dismissed in quick succession, reducing South Africa to 185 for three.
Rassie van der Dussen played a cameo of 40 runs, but South Africa kept on losing wickets at regular intervals and at one point they were reduced to 286 runs for the loss of seven wickets.
However, a late flurry of boundaries by Dwayne Pretorius (25) and Chris Morris (26) allowed the Proteas to post a challenging total on the board.
During South Africa's innings, Avishka Fernando had to leave the field after appearing to turn his ankle while trying to field a ball. The team later clarified that he underwent a scan, which revealed a minor ankle injury. He was strapped and iced and is expected to make a recovery.
South Africa next takes on West Indies in a warm-up fixture on May 26 whereas Sri Lanka will face Australia on May 27.
Brief Scores: South Africa 338/7 (F du Plessis 88, HM Amla 65, RAS Lakmal 2-63) defeat Sri Lanka 251 all out (FDM Karunaratne 87, AD Mathews 64, AL Phehlukwayo 4-36) by 87 runs.