De Kock, De Villiers lift South Africa to 339-5
South Africa captain AB de Villiers plays a shot during the third and final one-day international against Sri Lanka at the Mahinda Rajapaksa International Cricket Stadium in Hambantota on July 12, 2014 - by Ishara S. Kodikara
Left-hander De Kock smashed a 127-ball 128 while skipper De Villiers hit a fiery 71-ball 108, making a century off just 66 balls, as South Africa posted their highest total against Sri Lanka in windy conditions at Mahinda Rajapaksa Stadium in Hambantota.
South Africa's previous highest one-day total against Sri Lanka was 317-6 at Centurion in 2002.
De Kock gave South Africa, who won the toss and batted, an ideal start with a solid 118-run opening stand with Hashim Amla (48) and another 116 with his skipper for the third wicket to give South Africa an ideal chance to win the series tied at 1-1.
South Africa won the first one-day in Colombo by 75 runs while Sri Lanka restored parity with an 87-run victory in the second at Pallekele.
De Kock, dropped at 38 off Sachithra Senanayake, reached his fifth one-day hundred with a sharp single off 108 balls.
The talented left-hander holed out at mid-off in the 41st over but not before bettering South Africa's highest individual one-day score against Sri Lanka made by Boeta Dippenaar (125 not out) at Adelaide in 2006.
In all De Kock hit 12 fours and three sixes but was overshadowed by his skipper who smashed 11 boundaries and four sixes.
De Villiers was in a punishing mood, dancing and moving at the pitch with consummate ease to stroke his way to the third fastest one-day century by a South African behind Mark Boucher's 44-ball effort and his own 58-ball century in the past.
De Villiers hit two boundaries and then took a single off Angelo Mathews to complete his 17th one-day hundred.
In between Jacques Kallis missed out, trapped leg-before for just four to end a disappointing series with five runs, leaving a big question mark on his survival until next year's World Cup.
Sri Lanka had packed the side with five spinners, bringing in Rangana Herath for paceman Nuwan Kulasekara. South Africa replaced injured paceman Vernon Philander with Wayne Parnell.
Ace home paceman Lasith Malinga went for 85 runs in his 10 wicket-less overs.