Faf du Plessis stepped down as captain of South Africa's test team on Monday ahead of an expected retirement from international cricket later this year.
Du Plessis quit as test and Twenty20 captain. He had already recently been replaced as one-day captain by Quinton de Kock.
De Kock, a wicketkeeper-batsman, is the front-runner to also replace du Plessis as captain in tests and T20s. He led South Africa in this month's T20 series against England while du Plessis was rested.
The 35-year-old du Plessis had led the test team as permanent captain since late 2016 and was captain in all three formats since 2017. He had stepped in as South Africa captain in a T20 series as early as 2012.
Du Plessis' decision was not a surprise.
He had indicated during the recent home test series against England that his time in charge was coming to an end. He said he'd committed to playing for South Africa until the World Twenty20 in Australia in October and November and that's now likely to be his swansong with the Proteas.
In tests, du Plessis will likely play one more series, when South Africa goes to the West Indies for a two-match series in July.
Du Plessis said it was the right time for him to step down and allow a new generation of leaders to emerge. He wanted to still play in all three formats for now, he said, and contribute as a batsman and senior player.
Du Plessis is the only South Africa test captain to win test series home and away against Australia and was one of the Proteas' best leaders.
Between 2016 and early 2018, South Africa won eight of nine test series home and away, beating Australia twice and India during that period. But the last year had been difficult with South Africa's loss of form on the field exacerbated by off-field issues at the national board, which has suspended its CEO amid allegations of mismanagement.
Du Plessis lost his last three test series in charge, at home to Sri Lanka, away to India and at home to England last month. During that England series, he said the last year had probably been the toughest he had experienced as captain.
"The last few weeks of rest away from the game have given me a lot of perspective on the great privilege and honor I have had in representing and leading my country in the three formats of this wonderful game," he said. "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."
Du Plessis is expected to be selected to play as a batsman in home T20 and ODI series against Australia, which start this week.