Captain and the tournament’s leading wicket-taker Dunith Wellalage posted 113 for Sri Lanka as they set South Africa 233 to win.
The Proteas scored well but lost wickets cheaply as they were bundled out for 167 as Sri Lanka set up a meeting with either Bangladesh or Pakistan.
Sri Lanka won the toss and skipper Wellalage chose to bat and it was not long before the star man was out in the middle.
Openers Chamindu Wickramasinghe and Sadisha Rajapaksa could put on only 14 for the first-wicket stand as Kwena Maphaka bowled Rajapaksa.
The left-arm seamer then dismissed Wickramsinghe three balls later before Sakuna Liyanage went for an eight-ball duck to bring Wellalage out to the middle with Sri Lanka precarious on 25 for three.
Alongside Shevon Daniel, the skipper added 62 runs before forming an even more fruitful partnership with Ranuda Somarathne, putting on 130 runs for the fifth wicket.
Wellalage was eventually dismissed by Maphaka but only after hitting 113 off 130 for his first century of the tournament.
Somarathne would end on 57 not out as Sri Lanka set South Africa a chase of 232, which would prove too much for the Proteas.
Opener Jade Smith was run out for one as Sri Lanka took regular wickets to stint South Africa’s progress.
The usually free-flowing Dewald Brevis was next to go before Ronan Hermann and Gerhardus Maree added 34 and 44 respectively to move South Africa to 112 for six.
The Proteas were scoring above the required run rate but frequent dismissals hampered their progress as the Sri Lankan bowlers split the wickets between them.
Wicketkeeper Anjala Bandara took his second stumping to dismiss Maphaka as South Africa fell 67 runs short and will now go into the 7th place play-off.
Uganda win rain-affected match to seal 13th place
The 13th-place play off between Uganda and Scotland got off to a delayed start in Diego Martin, Trinidad and Tobago as rain prevented the two sides taking the field for over an hour and the game was initially reduced to 45 overs a side.
Before the weather intervened, Uganda had won the toss and chosen to bat first – a decision which saw four of their top five make scores over 30.
Ronald Lutaaya top-scored with 64 adding 75 runs for the third wicket alongside captain Pascal Murungi.
Both were eventually dismissed by Jamie Cairns, two of the left arm spinner’s four caught and bowled, on his way to the best bowling figures of the tournament with six for 24.
Cairns took the final wicket of Edwin Nuwagaba to bowl Uganda out for 226 with 14.2 overs of their innings remaining.
Charlie Tear was out for a first ball duck, with Muhaymen Majeed following him back to the dugout not soon after having both been dismissed by Juma Miyaji before Oliver Davidson and Tomas Mackintosh steadied the Scottish ship with a partnership of 46 runs.
Jack Jarvis then came in to replace Mackintosh and scored quickly as he added 37 off 33 balls but rain would intervene again with Scotland on 122 for seven and two new batters at the crease.
The weather brightened but Scotland’s task only got harder as they were now chasing the same target but only had 11 overs in which to do it.
Captain Charlie Peet played a cautious innings as he looked to stay the distance, but could not find a partner, as Rafay Khan fell for 10 and Cairns a duck before Sean Fischer-Keogh’s dismissal left him stranded on 29 not out.
Scotland ended their World Cup 51 runs short (D/L method) of Uganda finishing 14th in the tournament, meaning the Baby Cranes claim 13th spot at the ICC Under 19 Men’s Cricket World Cup 2022.