Faf du Plessis has stepped down as captain of South Africa with immediate effect, revealing he will no longer lead the Proteas in any format.
The announcement came shortly after Australia's arrival in Johannesburg for a Twenty20 series that starts on Friday (NZ time).
Du Plessis stepped down as ODI captain last month, handing the reins to Quinton de Kock, but he remained in charge of the test and T20 teams prior to Tuesday's revelation.
The 35-year-old had previously outlined his intention to lead the side through to the T20 World Cup that starts in Australia in October.
"In a perfect world I would have loved to lead the team in the tests for the rest of the season as well as the T20 World Cup, but sometimes the most important attribute of a leader is to be selfless," du Plessis said in a statement.
"I have striven to lead the team with dignity and authenticity during exhilarating highs and devastating lows. I have given my everything during my tenure.
"I have never been one to throw in the towel and do believe I am putting the team first, and believe we have to stick through the tough times to get to the good times.
"I am healthy, fit, energised and motivated, and certainly see myself playing an important role in the squad for as long as I continue putting in winning performances for the team."
Du Plessis remains the only skipper to have led South Africa to test and ODI series wins against Australia at home and away.
The batsman routinely saved his best for Australia, most recently producing a one-day ton that consigned Aaron Finch's team to a costly shock World Cup loss last year.
He also regularly rubbed Australia up the wrong way, having likened the opposition to a "pack of dogs" after several Australian fielders hounded the right-hander for picking up the ball during a spiteful Cape Town test in 2014.
Du Plessis played a leading role in two recent low points for Australian cricket.
He captained the XI that skittled the Aussies for 85 in Hobart during 2016, prompting chairman of selectors Rod Marsh's resignation and some six changes to the hosts' test squad.
Du Plessis' celebrations of that series win were somewhat muted given he was furiously defending allegations of using a mint to illegally change the condition of the ball; one of two times he was found guilty of tampering.
He went on to lead his team during Australia's tour of South Africa in 2018, later expressing sympathy towards Steve Smith and David Warner as the sandpaper scandal erupted.