Australia coach Darren Lehmann said: "It was a bit of a surprise. It's mid-tour, but obviously he's decided he's had enough.
A number of England players took to Twitter to praise Swann.
"Congrats on an amazing career mate you can be a very proud man," said England wicketkeeper Matt Prior
Fellow England and Nottinghamshire bowler
Stuart Broad added:
"A great friend and team-mate retired today. Been a pleasure to play and tour for Nottinghamshire and England."
Following the departure of batsman Jonathan Trott with a stress-related illness earlier in the tour, Swann's retirement further unsettles England ahead of the fourth Test, which starts in Melbourne on Boxing Day.
Graeme Swann: "It's time for someone else to strap themselves in and enjoy the ride - like I have done"
"I know I'm making the decision for the right reasons," added Swann.
"My body doesn't like playing five-day cricket any more and I don't feel I can justify my spot in the team in the latter stages of a game.
"As a spinner, that's when you need to come into your own.
"With two games to go in Australia and then a fiercely competitive summer against Sri Lanka and India, I feel that it is a great time for someone else to strap themselves in and hopefully enjoy the ride as much as I have."
Swann, first named in an England squad back in 1999-2000, made his Test debut in 2008 and took four wickets against India in Chennai.
He established a reputation for taking wickets in the first over of a spell and became the sixth-highest wicket-taker for his country.
Tom FordyceChief sports writer
"If anyone had been in any doubt after the Ashes were lost with those three thumping defeats, Graeme Swann's retirement confirms that this is the definitive end of the era for this England team.
"The question now, with this tour falling apart and a possible 5-0 'Pomwash' on the cards, is who might go next. Andy Flower? Kevin Pietersen?"
Despite struggling with elbow problems in recent years, Swann played in three Ashes series victories and helped England become the number one Test side in the world in 2011.
He also took 104 wickets in 79 one-day internationals after making his debut against South Africa in Bloemfontein in 2000 at the age of 20 and spent a spell as the top-ranked ODI bowler in 2011.
In addition, he helped England clinch their first major global world title at the 2010 World Twenty20 in the Caribbean.
"My personal highlights include the three Ashes victories, which I will cherish for the rest of my life, and the World T20 victory in the West Indies, which ranks as my limited overs highlight," he added.
"I have met, played with and against, and become friends with some magnificent people throughout my journey and feel truly privileged to have been given these opportunities."
Swann was successfully targeted by Australia's batsman during the current Ashes series
Former England captain
said Swann had quit "too soon". adding: "Spinners of his quality are a rare breed. Of all the England players over the last 20 years, he is the one the team will miss the most."
BBC cricket correspondent
described Swann as a "true character" who had made a "massive contribution" to England.
"The general feeling was that this might be Swann's last tour, but this is unexpected. England's greatest challenge is replacing the man who was the lynchpin to their four-man attack."
England team director
paid tribute to Swann's "outstanding contribution" to the team.
"His commitment, competitive spirit and sense of humour have been recognised and admired by team-mates and supporters alike," he said. "He has played a big part in England's success over the last five years."
England bowler Tim Bresnan said Swann's retirement will be a relief to some batsmen around the world.
"I will miss your constant put downs and abuse of my mental capacity," Bresnan said on
"Also, many batsmen around the world have just exhaled a huge sigh of relief due to your constant challenge of the stumps and prodigious spin."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.