Dhoni made his debut with India in 2004, where he eventually became the captain, leading India to the inaugural World Twenty20 title in 2007, as well as the 2011 World Cup and the 2013 Champions Trophy.
In a post on Instagram, the wicketkeeper said, "Thanks a lot for ur love and support throughout.from 1929 hrs consider me as Retired."
The 39-year-old scored 10,773 one-day international (ODI) runs -- the 11th highest tally in history -- in 350 games.
He also played 90 Tests, scoring 4,876 Test runs and guiding India to the top of the world rankings before retiring from test cricket in 2014. He played 98 T20s as well.
He captained India in a record 322 international matches and his 110 ODI wins in charge is second only to Australia's Ricky Ponting's 165.
Dhoni also won the Indian Premier League (IPL) three times with Chennai Super Kings.
Many in the cricketing community paid their respects to Dhoni on social media, including current India captain Virat Kohli.
"Every cricketer has to end his journey one day, but still when someone you've gotten to know so closely announces that decision, you feel the emotion much more," Kohli said on Twitter.
"What you've done for the country will always remain in everyone's heart, but the mutual respect and warmth I've received from you will always stay in mine. The world has seen achievements, I've seen the person. Thanks for everything skip. I tip my hat to you."