​Andres Iniesta has confirmed that he is set to leave Barcelona at the end of the season.

The legendary midfielder is out of contract in the summer, and speculation has been rife about whether he would stay at Nou Camp or look to leave after 22 years at the club he joined as a 12-year-old.

Iniesta has ​now officially made his decision public, with the veteran playmaker revealing that he he will depart Catalonia once the 2017/18 campaign draws to a close but it remains to be seen whether he will complete a reported switch to America to join an MLS side or move to China.

Speaking at the official announcement on his future, an emotional Iniesta said: "I want to make public my decision that this is my last season at FC Barcelona. It is a decision that I have considered, valued and designed internally.

"For me, Barça is the best club in the world - this club has given me everything. My stage ends this year. This team deserves the best of me and in the near future could not give the best of me, both physically and mentally.

"It's very tough for me to say goodbye. Thanks to the club, all of my teammates, my wife and family, and those who have been there every day these years. All the fans, for their unconditional affection. As a person your support has been unbelievable."

(You may also be interested in ​Barcelona President Insists Andres Iniesta 'Defined An Era' Ahead of Expected Summer Departure)

Iniesta is believed to have told his family and close friends about his transfer a while ago, but he has waited until now to tell both his teammates and the world's media about the next chapter in his career.

Iniesta has been part of the first-team squad with the current La Liga leaders since July 2002, and has amassed an extraordinary 670 appearances over 16 full seasons with La Blaugrana.

His longevity in Catalonia, coupled with a haul of 29 titles including eight Spanish top flight trophies and four Champions Leagues, has marked him down as a legend at Barca, but the club captain feels it is time to move on and allow the next batch of talented La Masia academy graduates to make history with Barca.

Barca had tried to convince Iniesta to remain part of manager Ernesto Valverde's plans, but those please have fallen on deaf ears and he will now up sticks once this term ends in a month's time.