West Indies 266 for 9 (Samuels 68, Russell 64*, Sammy 51, Behardien 2-21) beat South Africa 262 for 8 (Miller 130*, Holder 4-53) by one wicket
Scorecard and ball-by-ball details
At last it was competitive. After three one-sided matches in a series that was decided before this game began, there was a thriller in Port Elizabeth as Andre Russell carried West Indies over the line for a one-wicket victory.
It provided Jason Holder his first victory in charge of West Indies' and it came in a manner he will not forget. His attack restricted South Africa to a reasonable score by getting into their middle-order early and then cancelled out David Miller's maiden ODI century with fifties from Marlon Samuels, Darren Sammy and Russell, who held his nerve when the pressure could have reached breaking point at the end.
Russell scored 64 off 40 deliveries, including three sixes off his last eight balls with No. 11 Sheldon Cottrell for company, and settled nerves which would have started to jangled from the third ball of the innings when Dwayne Smith was bowled by a full, fast Morne Morkel delivery.
That West Indies found themselves on the brink of victory was thanks to Samuels' patience, Sammy's determination and South Africa's slew of freebies after they had slipped to 73 for 5. With three-quarters of their frontline atrack rested, they sent down 14 wides and a no-ball which left de Villiers baffled over their ill-discipline.
What de Villiers was more sure about was how to manage his bowlers. He used them in short spells and made some inspired bowing changes, including bringing on JP Duminy on in the Powerplay, which resulted in the wicket of Chris Gayle first ball, and Farhaan Behardien in the 16th over. Behardien found a hint of movement and trapped Denesh Ramdin lbw to leave West Indies teetering on 48 for 4.
Samuels watched the early carnage with a patience he had not shown earlier in the series. Instead of attacking the spinner, this time Aaron Phangiso not Imran Tahir, immediately, he hung back. That proved a wise decision as he witnessed the run-outs of both Leon Johnson and Jonathan Carter while he was at the crease and only really began to chip away at the target once joined by Sammy.
The pair seemed to understand each other better, rotated strike without risk and took boundaries when Kyle Abbott and Wayne Parnell missed their lines. Their 93-run sixth-wicket stand saw Samuels reach fifty off 70 balls and Sammy off 47. The former captain was the more aggressive and it cost him when he tried to send Parnell over cover but was caught by a backpedalling de Villiers.
Sammy was replaced by the equally forceful Russell, who picked up where Sammy left off albeit in slightly more difficult circumstances. Although South Africa's bowling made run scoring easier, especially as Morkel's later spell were expensive, West Indies lost Samuels, Jason Holder and Carlos Brathwaite as Russell seemed destined to run out of partners.
However, he just kept hitting though and took West Indies from needing 43 off the last six overs to seven off the last two and victory with nine balls to spare.
South Africa may have known their total was slightly below par when they needed Miller to smack 30 runs off the last 11 deliveries he faced to propel them over 250, after he fought out a century in 122 balls. Miller had support from Duminy through the early part of his innings and the pair shared a fifth-wicket partnership of 90 but he lacked any other significant partner. Parnell contributed 12 runs in a seventh-wicket stand of 63 but South Africa needed more after their top order - missing Hashim Amla - was removed relatively cheaply.
Cottrell and Holder had South Africa stuttering at 32 for 3 thanks to a trio of sharp catches behind the batsmen to leave de Villiers with a big job. He was out for just 19, after being dropped on 6 by Sammy in his follow through, which meant South Africa were tested in one of the areas of their game which remains a concern ahead of the World Cup.
While Miller has proved he has both the temperament and technique to be more than just a big-hitting finisher, the underbelly remains fairly soft, especially against a disciplined attack. Holder, Sammy, Russell and Brathwaite stuck to tight lines and gave South Africa very little - just 86 runs in the 20 overs between 15 and 35 and only 22 runs in the Powerplay, which frustrated them.
South Africa were unable to cause a similar squeeze, despite Phangiso's best efforts. Abbott, Parnell and Phangiso do not inspire the same confidence as Dale Steyn, Vernon Philander and Tahir, especially on surfaces which require more subtle skills and were batsmen are willing to apply themselves, but that is what South Africa need to find out before the World Cup. West Indies just needed a morale-boosting win and that is exactly what they got.
Firdose Moonda is ESPNcricinfo's South Africa correspondent