Dambulla - Half-centuries from skipper Angelo Mathews and Niroshan Dickwella helped Sri Lanka post 244 for eight against South Africa in the second one-day international in Dambulla on Wednesday.
LIVE: Sri Lanka v Proteas, 2nd ODI
Both Mathews, who made an unbeaten 79 off 111 balls, and Dickwella, who hit a fluent 69, showed grit against a persistent bowling attack which took wickets regularly after the hosts elected to bat first.
Fast bowler Lungi Ngidi and fellow paceman Andile Phehlukwayo claimed three wickets each.
The Proteas won the opening ODI of the five-match series on Sunday.
Ngidi struck twice in his very first over - the second of the innings - to reduce Sri Lanka to 13-2. He had Upul Tharanga caught behind for nine and then trapped Kusal Mendis lbw for nought.
Dickwella, Sri Lanka's wicketkeeper-batsman, then got going with several valuable partnerships including a crucial 67-run fourth wicket stand with Mathews.
Phehlukwayo bowled Dickwella when the left-hander dragged a delivery onto his stumps midway into the innings.
Mathews hung on with an uncharacteristic sedate knock to reach his 36th ODI fifty and help his team post a total that seemingly keeps them in the hunt.
Ngidi, Phehlukwayo and pace spearhead Kagiso Rabada kept getting wickets to rattle Sri Lanka's middle and lower order and also checked the flow of runs in the last few overs.
The islanders managed just 28 runs from the final 30 deliveries.