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.
|Bolt angry with drugs test|
|Bad luck is not a coincidence – Kimmich concerned by Germany form|
|Mahomes: Chiefs need to win like Brady and the Patriots|
|Schuster warns Real Madrid not to panic-buy striker in January|
|We´re here to win! - Paine not happy celebrating a draw|
|Injured Thauvin out of Germany clash|
|Southgate hits out at early Premier League start|
|Modric to Inter talk is ´fantasy´, says Guardiola|
|Pats hand first loss to Chiefs after wild shoot-out|
|Cowboys, Ravens dominate as Pats beat Chiefs in NFL classic|
|Brady becomes first QB to 200 regular-season wins in NFL|
|Red Sox level series against Astros|
|Mbappe leaves red-faced Dembele on his backside|
|Red Sox ace Sale admitted to hospital with stomach illness|
|From UFC to NFL? McGregor throws pass for Cowboys|
|Ancelotti praises ´dangerous´ Mbappe|
|Uncapped Papalii named in All Blacks squad|
|Kane would star in LaLiga – Ramos|
|Guardiola unsure about Man City´s Champions League chances|
|Dzeko: Premier League return? You never know|
|Gurley dominates to help Rams beat Broncos|
|Butler expected to play Timberwolves´ opener against Spurs|
|I´m no wizard – Mancini asks for patience with Italy|
|The Messi and Ronaldo era is phenomenal – Guardiola|
|Dolphins defeat Bears in OT with 47-yard field goal|
|Almirola picks up win at Talladega|
|Wigan´s Sarginson wanted Grand Final glory in memory of brother|
|McLeish: Scotland keep shooting themselves in the foot|
|Sarries´ walking wounded a concern for Jones|
|Poland 0 Italy 1: Biraghi seals last-gasp win to keep final-four hopes alive|
|Seahawks top Raiders with blowout win in London|
|In-demand Hogg hints at Glasgow exit|
|Holder calls on Windies batsmen to step up after India whitewash|
|France´s World Cup win hurt me - Koscielny retires from international football|
|Bailey performs U-turn on Jamaica call-up|
|Evans becomes Buccaneers´ all-time leading receiver|
|Overlooked Alba is one of the world´s best, says Ramos|
|Del Potro a major ATP Finals doubt due to fractured patella|
|Gomez to replace suspended Stones for England|
|Luis Enrique applauds ´adaptive´ Southgate|
|Pepperell holds off Bjork for wire-to-wire British Masters glory|
|Steelers´ Shazier returns to Bengals´ stadium for first time since injury|
|Scotland 1 Portugal 3: Santos´ side pile misery on McLeish|
|Falcons prey on Toulon, Vunipola brothers injured in Sarries win|
|N´Golo Kante is fundamental for France – Lucas Hernandez|
|Real Madrid star Bale withdraws from Wales squad|
|50 Cent to meet Khabib for Bellator talks|
|Drink-driving charge does not change who I am – Lloris|
|Pavard backs Varane to beat favourites to Ballon d´Or|
|Gareth gives players more input - Henderson explains Southgate, Klopp contrast|
|Stephens qualifies for WTA Finals as Svitolina sits out Kremlin Cup|
|Disrespectful critics are treating us like amateurs - Hummels|
|Final Proteas-Zimbabwe T20 washed out|
|Deontay Wilder apologises for punching mascot on live TV|
|Irrepressible Djokovic hunting year-end number one|
|Henry has everything to be a success at Monaco – Deschamps|
|Shastri: Shaw plays like Tendulkar, Sehwag and Lara|
|Germany lose Boateng for key France fixture|
|Giorgi eases past Alexandrova to Linz title|
|Why not? I hope so - Lukaku harbours Serie A ambition|
|No regrets - ´Happy´ Hazard won´t sulk at Chelsea|
|Umesh inspires three-day victory after India´s early wobble|
|FIBA secretary general Patrick Baumann dies, aged 51|
|Emery has improved me already, says Xhaka|
|Southgate backs under-fire Rashford|
|Let´s go, Floyd! - ´King´ Khabib calls out Mayweather|
|Koeman calm after Netherlands make history against Germany|
|Injured Van Dijk to miss Belgium clash|
|Brilliant Djokovic extends winning run with Shanghai title|
|Atletico Madrid ambition behind Griezmann´s Ballon d´Or desire|