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.
|Proud captain Ozil revels in Arsenal´s ´sexy football´|
|Puel angry over Holding handball|
|Cilic breezes through in Basel, Anderson fights back|
|Ingram: Four-game ban better than we expected|
|Raiders send Cooper to Cowboys for first-round pick|
|Arsenal 3 Leicester City 1: Outstanding Ozil inspires comeback win|
|World Series 2018: Three reasons why the Dodgers will win|
|Yarmolenko out for six months after Achilles surgery|
|World Series 2018: Three reasons why the Red Sox will win|
|Ozil eclipses Klinsmann to become Premier League´s most prolific German|
|Allegri expecting Old Trafford battle against Mourinho´s United|
|Bertens feared she did not belong in Kerber clash|
|Returning Ronaldo expecting ´tough´ game against Manchester United|
|Cristiano Ronaldo confident of clearing his name amid rape allegation|
|Osaka looking to learn from losing start in Singapore|
|Kovac expects tough test against AEK Athens|
|Whyte gives Chisora deadline over rematch|
|Spartak Moscow sack Massimo Carrera|
|Atletico Madrid confirm fresh injury issue for Gimenez|
|Dolberg extends Ajax contract after Real Madrid links|
|Ronaldo an example for Lukaku to follow|
|Bertens battles back to blast past Kerber|
|Ramos apologises for training ground fracas|
|Raikkonen should take heed of Alonso misfortune as F1 career winds down|
|Guardiola wants Manchester City fans to push team to Champions League glory|
|Isco not interested in departed Ronaldo - he didn´t want to be here|
|World Series 2018: Three storylines to watch in Red Sox-Dodgers|
|Neymar focus bad for football - PSG´s Maxwell|
|Marco Ianni charged by FA over Jose Mourinho touchline row|
|Stephens sees off Osaka in see-saw Singapore battle|
|I´m happy at Manchester United - Mourinho dismisses Real Madrid reports|
|Semenya and Asher-Smith head IAAF Female World Athlete of the Year shortlist|
|Mandzukic to miss Manchester United trip|
|I turned down Manchester United to return to Juventus - Bonucci|
|Sanchez out of Manchester United´s clash with Juventus|
|Australia make Short work of run chase in T20 win|
|Brotherly g-love! Tommy Fury follows Tyson into the pros|
|Ozil´s international retirement can help Arsenal - Emery|
|If you sack Lopetegui, you have to sack us all – Isco|
|Lopetegui defiant amid Real Madrid sack reports|
|Sri Lanka spinner Herath to retire after Galle Test|
|Ronaldo returns for Old Trafford welcome amid disquieting noise|
|Garcia claims third Andalucia Valderrama Masters title|
|Ex-England international Waldrom retires|
|´Massive personality´ Hart can lift Burnley, says Kompany|
|Liverpool felt wrath of ´emotional´ Klopp, says Shaqiri|
|Reid: Jenkins capitalised on Kaepernick movement|
|Manchester United v Juventus: Ronaldo out to end dismal scoring record against Mourinho|
|Injured Ribery to miss Bayern´s clash with AEK|
|Wilshere would have stayed at Arsenal under Wenger|
|Mahomes stars again as Chiefs crush Bengals|
|Bolt must accept ´much less´ to join Mariners, says A-League chief|
|Klopp compares Liverpool to dog without favourite toy|
|Young leads Hawks to first win, Thunder fall in Westbrook´s return|
|Spalletti hits out at physical Milan – I had three players asking to be replaced|
|Cowboys, Ravens lose after missed kicks in final seconds|
|Hernangomez secures Nuggets´ win over Warriors with last-second block|
|Hasler returns to Manly on three-year deal|
|Sarri: Chelsea fans must respect Mourinho|
|Ronaldo learnt from Scholes – Pjanic praises Juventus star|
|CA dismisses spot-fixing claims|
|WATCH: Will Ferrell leads chants with LAFC fans|
|MLS Review: Galaxy on track for play-offs as Timbers, DC clinch spots|
|Elliott secures win at Hollywood Casino 400|
|Thunder´s Westbrook makes season debut against Kings|
|Saints beat Ravens after Tucker misses extra point|
|Rondo, Paul and Ingram banned after Lakers-Rockets fight|
|Saints QB Brees reaches another historic milestone|
|Biglia: VAR should have checked Nainggolan tackle|
|Gattuso not blaming Donnarumma for derby defeat|