BARCELONA- Barcelona midfielder and captain Xavi confirmed on Thursday he will leave his boyhood club at the end of the season and has agreed to join Qatari side Al Sadd after a glittering career stretching over 17 seasons. The 35-year-old former Spain international, who signed up with Barca's academy in 1991 aged 11 and has won 23 trophies with the first team, formally announced his departure at a press conference after the news had leaked out earlier this week.

Al Sadd simultaneously confirmed on their Twitter feed that an agreement had been sealed on a two-year contract with an option for a further year.

"It's a definitive decision, it's not an easy one, it's the right moment to go," an emotional Xavi, Barcelona's club captain and appearance record holder after 764 matches, told reporters.

"I still feel useful here but a change of scene is necessary, my head tells me so but not my heart," he said, adding that his aim was to return to Barcelona after completing his coaching qualifications.

"I am a product of the Barca family. I think my contribution has been very good, I have done what they taught me."

Xavi came to define Barca's possession-based playing style and has had a crucial role in the success of the Catalan club and the Spain national team over the past decade.

He is set to receive an emotional send-off in Barcelona's final La Liga game of the campaign at home to Deportivo La Coruna on Saturday, when he will hoist aloft the La Liga trophy after the match.