BARCELONA — Barcelona midfielder and captain Xavi confirmed 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 Saturday, when he will hoist aloft the La Liga trophy after the match. Last weekend Barca wrapped up the title, Xavi's eighth, and he can win two more trophies in the King's Cup final against Athletic Bilbao on May 30 and the Champions League showpiece versus Juventus a week later. Xavi said Barca had offered to extend his current contract by two years to 2018 but he had decided to move on as he no longer commands an automatic place in the first team. He almost left at the end of last season after Barcelona failed to win a major trophy for the first time in six years but new coach Luis Enrique, a former teammate, persuaded him to stay. “When you talk about the gala 11 my name is no longer there,” he said. “It's not easy to accept but the team has always come first.” — Reuters