South Africa was bowled out for 73 on Saturday, its lowest total since readmission to international cricket, as Sri Lanka won the first Test by 278 runs with two full days to spare.
Chasing a target of 352 to win, the Proteas were dismissed in their second innings just before tea on Day 3, losing all 10 wickets in a single session after going to lunch at 5-0.
Off-spinner Dilruwan Perera bowled unchanged from one end to claim career-best figures of 6-32, his seventh Test five-wicket haul. The 35-year-old ended with a match total of 10-78.
Earlier, veteran Dale Steyn claimed his 421st wicket in Test cricket to equal the South African record held by former great Shaun Pollock when he dismissed the last man Lakshan Sandakan to end Sri Lanka's second innings at 190.
South Africa's previous lowest Test total since readmission in 1991 was 79 in Nagpur against India three years ago, and the heavy defeat raised several questions about the tourists' ability to adapt to Asian conditions.
Both openers — Aiden Markram (19) and Dean Elgar (4) — were stumped while most other batsmen failed to execute the sweep shot effectively.
Perera's off-spin was well supported by Rangana Herath's left-arm orthodox spin as the 40-year-old claimed 3-38. The duo bowled unchanged for 28 overs with the new ball before left-arm wrist spinner Lakshan Sandakan accounted for last man Tabraiz Shamsi in his first over to complete the win 13 minutes before tea.
Vernon Philander was left stranded on 22, the highest score in South Africa's second innings.
Sri Lanka opener Dimuth Karunaratne was named the man of the match for his outstanding batting performance. The 30-year-old carried his bat in the first innings to post an unbeaten 158 and then hit 60 runs in Sri Lanka's second innings after the hosts resumed Saturday on 111-4. Keshav Maharaj took 4-58 and Kagiso Rabada claimed 3-44 to finish with seven wickets overall.
No other batsmen from either side managed to score a half-century in the game, proving Karunaratne's temperament on a tough wicket.
Karunaratne's aggregate of 218 runs in the game was more than the entire South African team's efforts in both innings with scores of 126 and 73. Sri Lanka scored 287 in its first innings.
It was South Africa's first test defeat in Sri Lanka since 2006.
The second Test starts Friday in Colombo at Sinhalese Sports Club.