Sri Lanka regained a measure of pride in the fourth ODI, holding their nerve to defeat South Africa by three runs in a thrilling rain-affected encounter on Wednesday.
The Proteas came into this clash holding an unassailable 3-0 lead in the five-match series, but the tourists were undone as they fell just short under the leadership of stand-in captain Quinton de Kock.
Kusal Perera, Dasun Shanaka and Thisara Perera all starred with the bat for the home side, clubbing rapid fifties - Shanaka, on his first ODI appearance in almost two years, the standout with four fours and five sixes in a 34-ball 65 that propelled Sri Lanka to 306-7 from just 39 overs.
A lengthy shower in the early stages of the second innings left South Africa needing 191 from 21 overs - an equation reduced to eight from the last with David Miller on strike but with only two wickets in hand.
And Suranga Lakmal struck the decisive blow, bowling Miller via an inside edge as the Proteas could only reach 187-9 to leave the Kandy crowd jubilant.
Following a couple of early rain delays, Sri Lanka made steady progress with openers Niroshan Dickwella (34) and Upul Tharanga (36) getting starts but at below a run a ball.
Kusal added some impetus, crunching six fours and a pair of maximums en route to a 32-ball 51 before his fun was ended by JP Duminy.
But it was his dismissal that brought Thisara and Shanaka together, the pair hammering 109 in 11.1 overs as the Proteas lost their way at the death - the latter taking 20 from five deliveries in the penultimate set of six bowled by ODI debutant Junior Dala.
Thisara (51 not out from 45) reached his half-century in the final over and after South Africa's reply was halted just two overs in, De Kock perished from the sixth ball following the resumption, missing a Lakmal full toss.
Hashim Amla (40) and Duminy (38) set the foundation for the chase with a 57-stand, ended when the former skewed Akila Dananjaya to backward point. Duminy was looking dangerous, having clubbed three fours and two sixes before he was superbly run out by Shanaka aiming at one stump.
Miller (21 off 17) and Keshav Maharaj (17 from 14) were South Africa's last vestiges of hope, and when both departed in the space of three balls late in the piece, Sri Lanka were able to celebrate avoiding a whitewash.
|´World´s best´ Alisson will be difficult to replace, says Roma boss Di Francesco|
|Dragons and Sharks pounce on Panthers after four get sin-binned|
|AC Milan situation has proved FFP works - UEFA president Ceferin|
|Marseille´s Garcia uninterested in striker despite Balotelli link|
|Goodhue sparkles on debut as All Blacks thump Wallabies|
|I feel like chicken tonight - Saunders game for a laugh after Wilder fowl play|
|Aubameyang-Lacazette partnership possible for Arsenal|
|Pant handed debut as India ring changes at Trent Bridge|
|Pochettino pledges to protect Kane|
|Federer relieved to ´hang tough´ in Cincinnati|
|De Bruyne injury: Can Foden or Diaz replace Man City playmaker?|
|Furyk confident as Team USA takes shape|
|Neymar´s behaviour deserves praise, Tite claims|
|Scherzer, Harper lead Nationals past Marlins|
|Djokovic and Federer join Cilic, Goffin in Cincinnati semis|
|Federer outlasts recovering Wawrinka|
|WATCH: Djokovic wins match, loses car|
|Bolt arrives in Sydney for A-League trial|
|Red-hot Bertens beats Svitolina, Halep marches on|
|Snedeker preserves Wyndham lead|
|Halep hits back to torment Tsurenko|
|Raonic fails to break Djokovic stranglehold|
|Emery seeks more ´demanding´ Ozil|
|CAF Champions League Review: Wydad, Al Ahly & TP Mazembe qualify|
|Stephen Curry wants to finish his career with Warriors|
|Hazard among Europe´s best but can improve, says Sarri|
|Tigers boost top-two hopes, Giants close in on fourth|
|Birmingham City 0 Swansea City 0: Monk´s men held despite dominance|
|Inter taking legal action against Tebas over Modric transfer comments|
|Serie A transfer round-up: Zaza joins Torino, Parma sign Gervinho|
|Roma chief Pallotta makes light of De Laurentiis claim|
|Federer starts double-header by seeing off resilient Mayer|
|Ospina joins Napoli on loan from Arsenal|
|Klavan completes Cagliari switch|
|Djokovic holds out against Dimitrov as Raonic awaits|
|New dates confirmed for postponed Serie A fixtures|
|Halep breezes past Barty to set up Tsurenko clash on same day|
|Olesen unable to capitalise on strong start as Jamieson, Waring go clear|
|Hoffenheim tie Kramaric to four-year deal|
|Mina to miss Southampton clash while Gomes is ´weeks´ away|
|Barcelona coach Valverde dismisses Pogba speculation|
|Valverde not prioritising Champions League over defending Barcelona´s LaLiga title|
|Allegri thanks outgoing Juventus icon Marchisio|
|Pants display from Beef? Johnston forced into change of trousers in Sweden|
|Tour champion Thomas has Welsh velodrome named in his honour|
|Gloucester surprised and disappointed by RFU´s swift Cipriani charge|
|Storm skipper Smith´s back injury not ´too serious´|
|Spurs fixture switch doesn´t appeal to Guardiola|
|Brazil call up Andreas Pereira & Arthur but omit Man City stars|
|Mbappe returns to PSG squad, Kehrer set for debut|
|No Messi in Argentina squad as Simeone wins first call-up|
|England man Roy embarrassed by self-inflicted facial injury|
|Atletico Madrid fined for breaching third-party regulations|
|Cipriani charged by RFU after common assault conviction|
|No contact, no negotiation - Leonardo denies AC Milan deal for Milinkovic-Savic|
|Kovacic set for Chelsea debut against Arsenal|
|Fury´s father restrained as Wilder crashes Pianeta weigh-in|
|Kohli and Bumrah fit for win-or-bust Test|
|Stokes ready and desperate to help England, says Root|
|Salah, Mane and Firmino not in competition says Klopp|
|Darmian staying at Manchester United, says Mourinho|
|Guardiola cites fatigue as factor for stricken De Bruyne|
|Kovac approves Rudy departure from bloated Bayern midfield|
|Klopp insists no player leaves without his approval amid Klavan rumours|
|Real Madrid complain to FIFA over Inter´s alleged Modric approach|
|Mourinho ´has never been so happy´ with unsettled Pogba|
|Manly implode amid Barrett uncertainty, Storm´s Smith injured|
|Sarri certain Hazard is staying at Chelsea|
|Liverpool, Champions League, Manchester derby - The matches De Bruyne will miss due to injury|
|Campbell joins Frosinone from Arsenal on permanent deal|