Former South Africa captain AB de Villiers said he had "run out of gas" as he announced his retirement from international cricket.
The 34-year-old has played in 114 Test matches, 228 one-day internationals and 78 Twenty20 matches for the Proteas.
He took time away from Test cricket in 2017, missing the series against England that summer, but returned to the red-ball side in December.
"I've had my turn and, to be honest, I'm tired," he said.
"This is a tough decision. I've thought long and hard about it and I'd like to retire still playing decent cricket.
"It would not be right for me to pick and choose where, when and in what format I play for the Proteas. For me, in green and gold, it must be everything or nothing."
De Villiers has a batting average of over 50 in both Test and ODI cricket.
He scored 8,765 Test runs for South Africa, and made his 22nd century in the format against Australia in March.
His final appearance for South Africa came in Johannesburg, where the Proteas beat Australia by 492 runs and clinched the series 3-1.