Faf du Plessis announced on Monday that he was stepping down as South Africa's cricket captain with immediate effect.
Du Plessis, 35, said he needed to take "a step back" from the captaincy in order to help the emergence of the next generation of leaders under Quinton de Kock.
De Kock led the team in recent one-day and Twenty20 internationals against England while Du Plessis was being rested.
It was announced last month that De Kock would be South Africa's long-term one-day captain but in Monday's statement, Du Plessis said he was also relinquishing the Test and T20 captaincy.
The announcement clears the way for De Kock to lead South Africa at the T20 World Cup in Australia in October and November and possibly to lead the Test team in a two-match series in the West Indies in July and August.
In a statement issued by Cricket South Africa, Du Plessis said he wanted to concentrate on contributing to the team as a batsman and senior player.
Du Plessis captained South Africa in 112 matches across all formats, including 36 Tests.
He said his time away from cricket since the end of the Test series against England last month had given him "a lot of perspective".
Du Plessis added, "It has been a rewarding, sometimes tough and other times a lonely road, but I would not replace the experience for anything, because it has made me the man that I am proud to be today."
He said the decision to step down was one of the toughest decisions he had made but he said he was committed to supporting De Kock, coach Mark Boucher and the rest of his teammates.
Du Plessis took over as limited overs captain in 2012 and became Test captain in 2016.