South Africa captain Graeme Smith has announced he will retire from international cricket after the third Test against Australia.
The current match at Newlands is the 33-year-old's 347th for South Africa, including 116 Tests, while his 109 matches as a Test captain is a record.
"This has been the most difficult decision I've ever made," he said.
"It's a decision I've been considering since my ankle surgery in April. I have a young family to consider."
He added: "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."
Entering the third and final match against Australia at his home ground, the left-hander had scored 9,257 Test runs at an average of 48.72, behind only the 13,289 of Jacques Kallis on the list of South Africa's all-time leading runscorers.
On the world list, only India's Sunil Gavaskar has scored more runs as an opener.
"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," added Smith.
"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 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."
Smith was first appointed as captain in 2003 having previously only played eight Tests.
At the age of 22, he was given the task of leading a team that had just been knocked out of its home World Cup in the first round and only a year on from the death of disgraced former captain Hansie Cronje.
Captaining on his first tour to England in 2003, Smith scored a double hundred in the first Test at Edgbaston before repeating the feat in the next Test at Lord's.
Overall, he has drawn one series and won two on his three Test tours of England, with each visit resulting in the resignation of an England captain - Nasser Hussain in 2003, Michael Vaughan in 2008 and Andrew Strauss in 2012.
The 2-0 series victory of 2012 lifted South Africa to the top of the world Test rankings, a place they will still occupy even if Australia dent the Proteas run of only one series defeat in their last 25.
"I have been fortunate to have had many highs, amongst them leading and being part of the best Test team in the world," said Smith.
"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."
Smith's exit comes only two months after Kallis quit Test cricket and, with Mark Boucher forced into retirement in 2012, the Proteas have lost a combined 430 Tests' worth of experience in less than two years.
Cricket South Africa chief executive Haroon Lorgat said: "He has been a mighty warrior, a leader of men and an exceptional part of our international cricket.
"Following the recent retirement of Jacques Kallis from Test cricket, there is no doubt that we are now ready to move into a new era and it is our job to build on the solid foundations that these great players leave behind."
AB de Villiers, South Africa's one-day captain, is now likely to be promoted to Test skipper, though his wicketkeeping duties in the five-day format could also lead to T20 captain Faf du Plessis being considered.
Smith, who has an Irish wife, signed a three-year deal to captain Surrey in 2012 and now looks free to concentrate on his commitments at The Oval.
A Surrey statement said: "Smith is due to arrive in London in early April, where he will lead Surrey into their 2014 campaign.
"The decision has no bearing on Smith's Surrey contract and he remains fully committed to the club."