Colombo - A gritty Proteas tail has fought off Sri Lanka's spinners to snatch a nerve-jangling draw in the second Test and seal a historic 1-0 series win.As it happened: Sri Lanka v SA - Day 5The series victory propelled South Africa to the top of world Test ranking ahead of Australia and also ended their 21-year-old jinx in Sri Lanka where they last won a Test series in 1993.South Africa had won the opening Test in Galle by 153 runs to go 1-0 up in the two-Test rubber.Chasing a target of 369, the visitors were reeling at 148-8 but tailenders Vernon Philander (27 not out) and Imran Tahir (four not out) hung on in the final nine overs to finish on 159-8."It started raining a bit so it took a few overs out," said Hashim Amla, who won his first series as South African captain."It was a tough battle. Lasting 110 overs on that wicket with quality spinners was credit to the guys."When we conceded 400 in the first innings, that was a setback, and then we were 13 for two. But it set it up nicely for the end."For Sri Lanka, it was only their second home series defeat since 2006.The South Africans were booed by the small but noisy crowd at the SSC ground after Tahir indulged in some time wasting tactics towards end of play.Starting the day at 38-1, South Africa added just 121 runs off 94 overs, opting for defensive batting rather than press for a win.To their credit, the Sri Lankan spinners gave it their all but constant rain breaks and sloppy fielding put paid to their efforts.Left-arm spinner Rangana Herath led the pack with 5 wickets from 45 overs while giving away just 40 runs. The stocky 36-year-old was well supported by off-spinner Dilruwan Perera who grabbed 3-60."It's disappointing not to end up on the winning side," said Sri Lankan captain Angelo Mathews. "We did everything right (but) they are a very hard team to beat, whether home or away."South Africa owed much to Amla who occupied the crease for close to three hours despite a troublesome hamstring, making 25 off 159 balls in a remarkable show of resistance.Amla, playing his first series since succeeding Graeme Smith as Test captain, at one stage faced 57 successive dot balls, frustrating the Sri Lankan bowlers no end.He was finally dismissed by Perera who had him caught by Mahela Jayawardene in the fourth over of the final session.Jayawardene then caught Faf du Plessis (10) for his 200th catch at slip to hand Herath his fourth wicket of the innings.Jayawardene, who struck 165 in the first innings, was later named man of the match while Dale Steyn was the man of the series.Jean-Paul Duminy (three) fended off the spinners for 65 balls before being trapped leg before off Perera.Herath had Steyn caught behind with just 20 minutes left for close of play, raising hopes of a Sri Lanka win.The second session saw Herath uproot the off-stump of AB De Villiers (12) after having Quinton de Kock (37) caught by Kithuruwan Vithanage at backward short leg.Opener Dean Elgar was dismissed by Perera in the truncated start-stop first session that saw the visitors add 17 runs off seven overs.Elgar made 13 off 65 balls and shared 43 runs for the second wicket with De Kock.The hosts, who posted 421 in their first essay, had bowled out South Africa for 282 in their first innings to gain a 139-run lead.Sri Lanka declared their second innings on 229-8.