Hashim Amla resigned as South Africa captain after drawing the second Test against England and promised a smooth transition to his immediate replacement AB de Villiers.

Amla intends to focus on his own batting, which had been in the doldrums throughout 2015, but there is a certain irony in the fact that he bows out having just scored a double century in Cape Town.

The 32-year-old became his country's first non-white Test skipper in mid-2014 after the retirement of long-term incumbent Graeme Smith and leaves having overseen four wins, four losses and six draws.

But that record was heavily weighted to the early days of his stewardship and a winless run spanning eight matches represents a new and unwanted record.

There was no sense of turmoil in the Proteas camp, despite the shock announcement shortly after play wrapped up at Newlands.

Instead, Amla relinquished the role with the kind of quiet dignity that has typified his career and offered his wholehearted backing to De Villiers, who will see out the series before a permanent decision is made.

"This decision was not an easy one to make but I felt I needed to be true to myself," he said.

"I am deeply grateful and privileged to have been the Test captain and I wish to thank Cricket South Africa for the honour of captaining my country. It was enjoyable and indeed a great learning experience.

"I gave it my best shot and I enjoyed it. But I feel there is a greater need to work on my own game, thus giving me the opportunity to continue contributing as a batsman.

"I've always thought as a player if you're not good enough you don't play so if someone can add more value to the team than me, then why wait and maybe be a hindrance to the guys.

"Get them in as soon as possible and maybe we can win the next two Tests.

"AB is very able and a brilliant captain. We all follow a similar goal. It doesn't matter if it's me pulling the rope or if it's AB, as long as we're all pulling in the right direction."

As captain Amla made 894 runs at 49.66, slightly down on his career mark of 51.13, but managed a top score of just 63 in 12 innings last year before his 201 at Newlands.

De Villiers, 31, has captained his country in 76 one-day internationals, winning 44 of them but losing semi-finals of the 2015 World Cup against New Zealand and the 2013 Champions Trophy against England.

He has also been in charge for 15 Twenty20 internationals, including World T20 tournaments in 2012 and 2014.

He said: "I've said this before, that it is an incredible honour to captain South Africa in any format. The (Test) captaincy has obviously come at short notice and is the realisation of a lifelong dream.

"At the moment my priority and focus is placed on leading this team to what can be a memorable series win against England. This Test squad is motivated and determined to turn our performances around and I'm looking forward to taking up that challenge as captain.

"Hashim is a good friend and close colleague and I am grateful for his support."

Three England captains fell on their sword before or after series against South Africa during Smith's reign - Nasser Hussain, Michael Vaughan and Andrew Strauss - and that fact was not lost on Amla's opposite number Alastair Cook.

He said: "It's a bit of a shock...normally it's an England captain who goes in a series against South Africa isn't it?

"It's a bit of a change...I've outlasted a South African captain."

Proteas coach Russell Domingo declared himself unhappy with some of the criticism that has been directed at Amla in recent months - particularly in the aftermath of a 3-0 loss in India.

"I honestly feel a lot of what Hashim has faced in the last couple of weeks has been very harsh," he said.

"He's one of South Africa's greatest ever players. I honestly feel there hasn't been enough respect for what he's achieved.

"He's sacrificed himself for the team and it speaks volumes for him."