The 37-year-old versatile cricketer's decision has effectively ended his association with his IPL franchise Royal Challengers Bangalore.
He made the announcement on Twitter, ending an illustrious career, which saw him play in 114 Tests, 228 ODIs and 78 T20Is for the Proteas.
In a statement released, De Villiers said: "It has been an incredible journey, but I have decided to retire from all cricket.
"Ever since the backyard matches with my older brothers, I have played the game with pure enjoyment and unbridled enthusiasm. Now, at the age of 37, that flame no longer burns so brightly.
"Last, I am aware that nothing would have been possible without the sacrifices made by my family – my parents, my brothers, my wife Danielle and my children. I look forward to the next chapter of our lives when I can truly put them first." The former South Africa captain and batting mainstay had retired from international cricket in 2018.
"I would like to thank every teammate, every opponent, every coach, every physio and every staff member who has travelled the same path, and I am humbled by the support I have received in South Africa, in India, wherever I have played. "Cricket has been exceptionally kind to me. Whether playing for the Titans, or the Proteas, or RCB, or around the world, the game has given me unimagined experiences and opportunities, and I will always be grateful.
"That's the reality I must accept - and, even if it may seem sudden, that is why I am making this announcement today. I've had my time," de Villiers added.
Since starting his association with RCB in 2011, he has enjoyed 11 fruitful seasons with the franchise and was its batting mainstay alongside Virat Kohli.
De Villiers has played 156 matches for RCB and scored 4,491 runs. He is the second all-time leading run scorer behind Kohli and holds the second and third-highest individual run total in RCB history with 133 not out against Mumbai Indians (in 2015) and 129 not out against Gujarat Lions (in 2016).
Speaking about his association with the Indian club, de Villiers said, "I have had a long and fruitful time playing for RCB. Eleven years have just whizzed by and leaving the boys is extremely bittersweet. "Of course, arriving at this decision took a lot of time, but after a lot of contemplation, I've decided to hang up my boots and spend quality time with my family. I would like to thank the RCB management, my friend Virat Kohli, teammates, coaches, support staff, fans, and the entire RCB family for showing faith and supporting me all through these years. "It has been a memorable journey with RCB. Have so many memories on the personal front to cherish for the lifetime. RCB will always be very close to me and my family and will continue to support this amazing team. I am a RCBian forever." De Villiers has played 114 Tests and scored 8,765 runs at an average of 50.66. He has also taken two Test wickets. His highest score was 278 not out and also has 22 centuries against his name. Making his Test debut against England in 2004, de Villiers has been one of the star performers of South Africa.
He has been a 360 degree player in ODIs and T20 Internationals. De Villiers has played 228 ODIs and scored 9577 runs at an impressive average of 53.50. His highest score in ODIs was 176 at an strike rate of 101.09. He has scored 25 centuries in ODIs. He made his ODI debut in 2005 against England.
In 78 T20 internationals, he has scored 1672 runs at an average of 26.12. He made his T20 international debut in 2006 against Australia.
The franchise said he "will go down as one of the greatest players in the team's illustrious history".
RCB chairman Prathmesh Mishra said, "AB de Villiers has been among the best ambassadors of the game, and we are honoured to have him represent RCB in the IPL. His work ethics have been impeccable, which has not only rubbed off on the team, but has left a high benchmark for other youngsters to follow. "AB has been a true leader, both on and off the field and we would like to express our heartfelt gratitude for his tireless commitment in helping RCB establish itself as one of the premier franchises in the IPL. "We wish AB all the best for his next innings in life. He will always be part of the RCB family."