Oshada Fernando and Kusal Mendis have struck unbeaten half-centuries for Sri Lanka to claim a historic eight-wicket win in Port Elizabeth to become the first Asian side to win a test series in South Africa.
Before this series, Sri Lanka had not won a game in any format since October but comfortably chased down a victory target of 197 runs on the third day at St George's Park for a 2-0 triumph.
Sri Lanka claimed a thrilling first test victory in Durban by one wicket and outplayed South Africa in the second, setting up their victory by skittling the hosts for 128 in their second innings.
Mendis scored 84 and Fernando made 75, putting on an unbroken stand of 163 for the third wicket as they pummelled the much-vaunted South African bowling attack on a wicket that became easier to bat on through the contest.
"It's a great feeling for me and the team. It's not easy when you come to South Africa so, to win the series 2-0, is brilliant," Sri Lankan captain Dimuth Karunaratne said at the post-match presentation.
"It has been a lot of hard work, but the guys did really well and enjoyed it a lot, which is why I think we created history.
"This victory is dedicated to the Sri Lanka fans who have continued to support us because they were always behind us when we were losing. We wanted to do something here for them."
Sri Lanka had resumed on the third morning on 2-60, although effectively three down with spinner Lasith Embuldeniya out of the test with a broken thumb.
As has been the case through the series, Sri Lankan batsmen looked to attack the Proteas' bowling.
Fernando, who made his debut in the series, completed his maiden half- century off 69 balls, providing the perfect foil for the more-aggressive Mendis.
It marked another key breakthrough for Asian teams this season after India had won their first test series in Australia, suggesting tours to countries with pacy and bouncy wickets were becoming less daunting.
South Africa's run of seven-consecutive home test series wins ended abruptly and captain Faf du Plessis said their misfiring batsmen must shoulder the blame.
"I thought we were poor with the bat throughout the series," du Plessis said. "I thought, in general through the series, both teams probably didn't perform with the bat on two pitches that were very conducive to scoring runs.
"Today for the first time, there was a real display of what should have happened in the rest of the series - two guys getting together and scoring some big runs.
"On this wicket, we should have scored a lot more runs."