Sri Lanka won a one-day international series for the first time in 19 months when it sunk South Africa for 125 runs on Tuesday.
A third and final match that was expected to be ripe for the batsmen was instead dominated by the bowlers, as 19 wickets fell in 80 overs, 16 to spinners, the second most in men's ODI history.
Sri Lanka struggled to 203-9 but still won by 78 runs.
Offspinner Maheesh Theekshana, given his Sri Lanka debut, got a wicket with his first ball and finished with 4-37 and 10 valuable runs.
Legspinner Wanindu Hasaranga de Silva took 2-38, and fast bowler Dushmantha Chameera 2-16 and the player of the match award for an invaluable 29 at the tail that frustrated South Africa.
Charith Asalanka was also an award contender, contributing a maiden ODI wicket after a team-best 47 runs, just shy of a third consecutive fifty.
Asalanka held the batting together. He was also clever. He was caught in the outfield on 37, and Sri Lanka would have been 145-7 in the 35th over, but the delivery was a no ball because Asalanka noticed South Africa had too many players outside of the circle.
He was eventually the eighth man out at 166 after 41 overs, edging behind. South Africa would have believed it could be chasing less than 180 but Chameera's 29 helped Sri Lanka top 200 and see out its 50 overs.
South Africa bowled a record 40 overs of spin, seven more than its previous high. Stand-in captain Keshav Maharaj led with 3-38.
The chase was rocked early and regularly.
Opener Aiden Markram and first drop Reeza Hendricks were out trying to defend in the first three overs, and Rassie van der Dussen was dismissed by a great catch by Kuminda Mendis.
But the most unlucky was opener Janneman Malan, who had 18 off 19 balls when he edged Theekshana's first delivery to first slip. Immediately after, the teams came off for a rain delay of 40 minutes.
South Africa resumed on 45-4 and remained pinned down by the spin, the pressure building relentlessly.
A three-match Twenty20 series starts on Friday.