It is a sad end to a career that saw Flannery win 41 caps, including four starts in Ireland's 2009 Grand Slam campaign, play 94 times for Munster, win the Heineken Cup twice and get selected for the 2009 British & Irish Lions tour to South Africa.
Injury forced him to pull out of the Lions tour before the squad left after he fractured his elbow at the training camp in England.
"I'm very sad to have to announce my immediate retirement from rugby due to injury. Since my injury at the 2011 World Cup, I've struggled to regain the level of fitness required to play at this level," said Flannery.
"I feel incredibly privileged to have played with so many great players with Munster and with Ireland. To train hard and win trophies for Munster and Ireland alongside some of my best friends has been an amazing experience.
"I'm incredibly grateful for all the opportunities rugby has given me to date and i would like to thank all my friends, family, coaches and team-mates for their support along the way. Finally, I would like to thank all the Munster and Irish rugby fans who I have been so proud to represent over the course of my career."