Former Barcelona and Spain midfielder Xavi has announced that he will retire from playing football at the end of the season.

The 39-year-old currently plays for Al Sadd SC in Qatar and will become a coach after ending his 21-year spell as a player.

“What I have achieved in the last two decades has been a privilege,” he said as quoted by the club’s website.

“Therefore, I believe it is my duty to take the initiative of the field and return through football whenever possible.”

The midfielder left Barcelona in 2015 and joined Al Sadd on a three-year contract. He won eight La Liga titles and four Champions League trophies while in Spain and lifted the league championship with the Qatari club this season.