CAPE TOWN - South African talisman AB de Villiers announced his retirement from all forms of international cricket on Wednesday, saying he was tired and wanted to step out while still at the top.

"After 114 test matches, 228 one day internationals and 78 T20 internationals it is time for others to take over. I've had my turn and to be honest I'm tired," he said in a video message on Twitter and in a statement.

"This is a tough decision, I have thought long and hard about it and I'd like to retire while still playing decent cricket. After the fantastic (test) series wins against India and Australia, now feels like the right time to step aside.

"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 the green and gold, it must be everything or nothing," he added.

The 34-year-old, whose swashbuckling batting style and razor sharp fielding has made him one of the sport's leading lights, only returned to test cricket in December after a lengthy hiatus where he focused on the limited overs formats of the game.

"It's not about earning more somewhere else, it's about running out of gas and feeling that it is the right time to move on," he said. "Everything comes to an end. To the cricket fans around South Africa and the world, thank you for your kindness and generosity, and today, for your understanding.

"I have no plans to play overseas, in fact, I hope I can continue to be available for the Titans in domestic cricket. I will continue to be the biggest supporter of (captain) Faf du Plessis and the Proteas."

CAREER GOALS

With a young family, De Villiers has hinted at international retirement in the last few years, but this past season committed to playing for his country in all three formats.

In his 2016 autobiography, he revealed he had two major career goals remaining -- to beat Australia in a home test series and win the Cricket World Cup.

He achieved the first of those earlier this year, but said last month he was no longer as determined to complete the second in England next year.

"I'm taking it one game at a time," De Villiers was quoted as saying by the International Cricket Council website.

"My ultimate dream is not to win a World Cup. I've changed my mindset. I feel it will be nice to win it, it'll be a bonus, but if I don't, it's not going to define my career."

De Villiers retires with a test average of 50.66 and as the fourth-highest scorer for South Africa with 8,765 runs. He made 22 test centuries and also took 222 catches and five stumpings, having spent part of his career in the role of wicketkeeper.

In ODI cricket, he holds the records for the fastest 50 (16 balls), 100 (31 balls) and 150 (64 balls).

"AB is one of the all-time greats of South African cricket who has thrilled spectators around the world with his sheer brilliance, coupled to his ability to innovate and take modern day batting in all three formats but particularly in the white ball ones to new levels," said Cricket South Africa president Chris Nenzani.

(Additional reporting by Nick Said; Editing by Christian Radnedge) ((mark.gleeson@thomsonreuters.com; +27 82 8257807; Reuters Messaging: mark.gleeson.thomsonreuters.com@reuters.net))