South Africa qualified for the Champions Trophy semi-finals at West Indies' expense after their Group B fixture ended in a tie.
Set a target of 231 in 31 overs, Kieron Pollard's dismissal from the final delivery before rain brought a premature end to the contest meant West Indies finished on 190-6 in 26.1 overs - level with the Duckworth/Lewis par score.
Had Pollard not gifted his wicket with a wild swing at Ryan McLaren's bowling, the resulting catch well held by Dale Steyn at third-man, West Indies would have won the game.
Instead, each side earned a point from the tie, giving both three points in the final Group B table, but South Africa go through to the last four alongside group winners India by virtue of their superior net run-rate.
South Africa opener Colin Ingram had earlier led the way with 73 after the rain cleared in Cardiff to allow a reduced-overs match.
The left-hander hit six fours and two sixes in his 63-ball effort and received good support from opening partner Hashim Amla (23) and skipper AB de Villiers (37) during stands worth 80 and 44 for the first and second wickets respectively.
Ingram was caught in the deep by Darren Bravo off Pollard's bowling after going for a big heave into the leg side but Faf du Plessis (35) and David Miller (38) ensured South Africa got up to 230-6 from their 31 overs.
Chris Gayle (36) and Devon Smith (30) put West Indies on course before a middle-order stutter saw them reduced to 104-4 in the 18th over.
Marlon Samuels revived their hopes with a flurry of boundaries after a brief rain delay in which no further overs were lost.
With dark clouds again looming, Samuels dispatched six fours and two sixes to get West Indies up with the D/L par score.
But South Africa fast bowler Steyn (2-33) removed Samuels' middle stump to end his 38-ball 48 and Pollard's exit three overs later for 28 sealed West Indies' fate.
Darren Sammy came out to join his skipper Dwayne Bravo (8no) in the middle but by now the rain was falling heavily, leaving umpires Steve Davis and Rod Tucker no option but to take the players off and end the game.
The late turn of events represented a change in fortune for South Africa, who have suffered plenty of one-day tournament heartbreak in the past, most notably their early exit from the 2003 World Cup on home soil after misreading the D/L sheet against Sri Lanka in Durban.