Sri Lanka spinner Dilruwan Perera.
Sri Lanka's formidable battery of tireless spinners bowled them to within five wickets of a 2-0 series sweep over South Africa as the tourists continued to struggle against the turning ball in the second and final Test on Sunday.
Skipper Faf du Plessis top-scored for the tourists with a fluent 48, while Quinton de Kock contributed 32 as South Africa once again capitulated to the home side's slow bowlers and failed to reach the 150-mark in the series. Amla took a single off the drop catch to bring up 9000 test runs, becoming the third South African to the landmark after Jacques Kallis and Graeme Smith.
The 28-year-old, who claimed eight wickets on the first day's play, dismissed Sri Lanka's last man Rangana Herath on day two to establish the new record.
Maharaj's nine-wicket spree was South Africa's best in an innings since the country's post-apartheid return to Test cricket in 1991.
To say that the day belonged to Dananjaya would not be an understatement for before he wrecked the South African batting and frustrated their bowlers on the field by batting for almost two hours to score a career best 43 not out off 91 balls (7 fours). Sri Lanka also lost Kusal Mendis when he was run out for 18.
Mathews made 71 before being dismissed by South Africa's left-arm spinner Keshav Maharaj who finished with a 12-wicket match haul.
Resuming on 139-5 with a comprehensive defeat looming over them, South Africa appeared to have suddenly discovered a stomach for fight which was conspicuously absent in the series.