The opening batsman has scored 8,314 runs at an average of 49.78 in 102 Tests, including 25 centuries.

Smith, whose wife is from the Republic of Ireland, will join Surrey after South Africa's home series against Pakistan, which will finish in late March.

"When you consider the ambition shown it was an easy decision for myself and my family," he said.

"I am excited about what we can achieve at Surrey going forward and I look forward to continuing to represent my country for many years to come."

Smith will be available for the majority of Surrey's matches next season, with the club hopeful he will play in 10 County Championship matches as well as leading the side in Twenty20 and 40-over competitions.

The left-hander will be unavailable to play for Surrey while he is representing South Africa in the ICC Champions Trophy, which is being held in England in June next year.

Surrey team director Chris Adams described the signing as a "massive coup".

"By signing a three-year deal, Graeme has demonstrated his commitment to Surrey on a long-term basis," the former Sussex captain told BBC London 94.9.

South Africa's schedule

Nov-Dec 2012: Tour to Australia

Dec 2012-Jan 2013: Home to N Zealand

Feb-Mar 2013: Home to Pakistan

June 2013: Champions Trophy

Oct-Nov 2013: Tour to Pakistan

Nov 2013-Jan 2014: Home to India

Feb-Mar 2014: Home to Australia

Smith, who spent a season at Somerset in 2005, replaces Gareth Batty as captain at The Oval.

Batty took over as skipper on a short-term basis after Rory Hamilton-Brown, who joined Sussex in September, stood down from the role in August.

"We've had a very, very difficult summer," Adams admitted on BBC Radio 5 live. "One of our players got killed in tragic circumstances, he happened to be the best mate of the captain of the club and Rory, understandably, found it difficult to see a future at Surrey.

"We were faced with replacing Rory, we drew a list up and right at the top was Graeme Smith, some would argue one of the great captains of all time. Add to that his ability with the bat as an opening batsman and he was the number one target.

"Graeme has reached a point in his career where he has done just about everything that he could wish to have done for South Africa, he will continue in that, the schedules are very favourable, it looks very clear he will be able to play the first half of the Championship season.

By joining Surrey, Smith will play alongside England batsman Kevin Pietersen, with whom he is thought to have had a fractious relationship since Pietersen left South Africa in 2000.

"I understand there is great mutual respect," Adams insisted. "I think they've had their moments through their careers but I think it's more than healthy at the moment.

"I've spoken to both about each other and they're both looking forward to the prospect of lining up with each other."