By Richard Martin
BARCELONA (Reuters) - Barcelona and Spain midfielder Xavi Hernandez will retire at the end of the season to move into coaching, calling time on a trophy-laden career spanning two decades.
Xavi, who has made a record 767 appearances for Barca and 133 for Spain, confirmed his retirement plans in an open letter sent to members of the Spanish media on Thursday.
"This is my last season as a player but I am looking forward to seeing what the future holds for me as a coach," wrote Xavi, who has been playing for Qatari side Al Sadd since leaving Barca in 2015.
"It has been a privilege to play football until 39 years of age and now I would like to finish the season on a high by winning the Emir Cup and by getting to the next phase of the Asian Champions League."
Xavi made his debut for Barca in 1998 after coming through the club's famed La Masia academy and soon became the heartbeat of the team's midfield, winning eight La Liga titles and four Champions League crowns before joining Al Sadd.
He was one of the key players when Spain won their first and only World Cup in 2010 as well as their European Championship triumphs in 2008 and 2012, eventually retiring from the national team after a disappointing 2014 World Cup.
Last month he helped Al Sadd win the Qatar Stars League, the country's top flight division, and has reached the quarter-finals of the Emir Cup with the team.
(Reporting by Richard Martin, editing by Pritha Sarkar)