Sri Lanka became the first Asian side to win a Test series in South Africa after sealing an eight-wicket victory in Port Elizabeth.
Dimuth Karunaratne's side - who are just the third nation, after England and Australia, to defeat the Proteas at home in a red-ball series - required just one session on day three to reach their target of 197.
The visitors resumed on 60-2 with Oshada Fernando and Kusal Mendis at the crease, and the third-wicket pair played with an equal amount of patience and aggression.
Mendis struck Dale Steyn for three boundaries to signal his intent after a quiet start to the morning before bringing up his half-century with a sumptuous off-drive off the fast bowler.
In stark contrast to the chaotic first session on day two, when the away side lost six wickets to fall to a first-innings deficit, Sri Lanka looked composed with history in their sights.
A maiden Test fifty for Fernando was brought up with an elegant whip to the midwicket boundary and with the target down to single figures, the 26-year-old skipped down the pitch to spinner Keshav Maharaj to launch the ball into the stands to leave just a single needed for a famous victory.
All-rounder Fernando (75 not out) nudged the ball wide of midwicket to begin wild celebrations from the visiting team and fans, as his third-wicket partnership with Mendis (84 not out) ended unbeaten on 163.
Watch the first one-day international between South Africa and Sri Lanka live on Sky Sports Cricket from 7.55am on Sunday, 3 March.