Graeme Smith has announced he will retire from international cricket at the conclusion of the final Test against Australia in Cape Town.
Smith, 33, is playing his 117th Test match - 109 of which have been as captain, a world record - and currently stands on 9257 runs. He revealed the news to his team-mates after the third day's play at Newlands. He said finishing on his home ground felt like the perfect ending and that it was something he had been considering since ankle surgery last year.
"This has been the most difficult decision I have ever had to make in my life," he said. "It's a decision that I have been considering since my ankle surgery in April last year. I have a young family to consider, and I felt that retiring at Newlands would be the best way to end it because I have called this place home since I was 18 years-old.
"I have always been someone who has left everything out there on the field for my team and for my country. I'm extremely honoured and proud to have had the privilege to lead so many wonderful players and to have been a part of building the Proteas culture to what it is today. It is a culture that every player can be, and is, immensely proud of."
In the current series, with one innings remaining, Smith has made just 42 runs and has been troubled particularly by Mitchell Johnson. He has not scored a half-century for eight innings - although did make 234 against Pakistan in October - and if South Africa lose against Australia it will be their first series loss since 2008-09. There were rumours before the India series late last year that Smith, who took on the captaincy in 2003, threatened to resign over selection issues.
His statement continued: "I would like to express my deepest gratitude to the support from my parents and brother, my wife and children, my friends, my sponsors, my fans and to Cricket South Africa. I thank and honour the players who I have played with and those who have supported me and helped me to be the person and captain I am today.
"I have been fortunate to have had many highs, amongst them leading and being part of the best Test team in the world. I will cherish these memories for the rest of my life. Thank you from the bottom of my heart. I bid my career a fond yet sad farewell."
One of many of the notable statistics in Smith's career is that none of his 27th Test hundreds have come in a defeat. Stand-out performances that he will be remembered for include back-to-back double hundreds against England in 2003, his series-winning innings at Edgbaston in 2008, captaining South Africa to a series with in Australia, during which he came out to bat with a broken hand in Sydney, and maintaining South Africa's formidable record on the subcontinent.
Smith's retirement follows quickly on from that of Jacques Kallis who quit Test cricket at the end of last year, although Kallis is aiming to extend his ODI career to take part in the World Cup. Smith's one-day career had appeared to be on the wane when he was dropped after last year's series against Pakistan in the UAE; in 197 ODIs he scored 6989 runs at 37.98 with 10 hundreds.
One of the impacts of Smith's retirement is that he will now be able to play for Surrey as a non-overseas player due to his Irish citizenship. The first year of his deal was cut short by his need for ankle surgery. When he signed his contract with Surrey there were suggestions at the time that he could end his South Africa career there and then.
Haroon Lorgat, the Cricket South Africa chief executive, admitted Smith's decision had come as a shock and praised his "nerves of steel".
"Although Graeme's decision to retire from all forms of international cricket comes as a surprise to all of us, we must respect him for deciding to call time," he said. "Knowing him as well as I do, having been instrumental as a selector in appointing him as a young captain, he would not have taken this decision lightly or without a great deal of thought.
"He has captained the Proteas for more than a decade and he will draw a lot more satisfaction from the fact that he leaves our Test team at the top of the world and in such good health rather than from all the personal records he has achieved as the longest-serving captain the game has ever seen in the demanding Test format.
"I would like us to remember Graeme for his nerves of steel and his match-winning performances that were synonymous with some of the most remarkable fourth innings victory chases of all time. These included setting up the 414 runs chase against Australia at Perth and his series-clinching innings at Edgbaston in 2008, not to mention the unbeaten century the last time he faced Australia at Newlands in 2011. His role in setting up the famous 438 win over Australia in 2006 was also a performance never to be forgotten.
"He can leave the game with pride and he thoroughly deserves the gratitude of our nation for leading the Proteas with much distinction. From a personal point of view I am thrilled that I was part of the panel that appointed him captain in 2003 when his first major assignment was a tough tour to England and I feel privileged to see him now move on to the next stage of his career. He has been a mighty warrior, a leader of men and an exceptional part of our international cricket."