Alongside the likes of Andres Iniesta and Iker Casillas he turned around the label of the Spanish national side from perennial underachievers to champions, triumphing at the 2010 World Cup and the last two European Championships.

"He has won my affection as a person, while for his football there are very few who cannot say he is a great player," said Spain coach Vicente del Bosque of the 34-year-old, who on Tuesday announced his retirement from international football.

"It is impossible to know who is the best player in the history of the Spanish national team, but that Xavi is one of the best is not in doubt. In the past there were some extraordinary players, but I cannot say who is better than others."

However, Xavi only appeared once during Spain's doomed defence of the World Cup in Brazil in June and his performance in the 5-1 thrashing at the hands of the Netherlands served as evidence that his time at the top is now in the past.

"It was the toughest defeat of my career," he admitted afterwards.

Xavi was also questioned for his performances early on at Euro 2012, but Del Bosque remained faithful to his loyal servant and was rewarded with his best display of the tournament as Spain retained their title in style with a 4-0 thrashing of Italy in the final in Kiev.

Yet, two years on, he played no part as La Roja bowed out of the competition with a 2-0 defeat to Chile at the Maracana in Rio de Janeiro, and he did not feature in the 3-0 victory over Australia that wrapped up their campaign.

After so many years of relentless high-pressure matches for Barcelona and Spain, his tiring legs seemed to have finally run out of steam.

"It has been a wonderful, fantastic period for me. It has been an honour," he said on deciding to step down after winning 133 caps, the first of which came against the Netherlands in November 2000.

- One last challenge -

Xavi, who first emerged in the Spain teams that won the World Youth Championship in 1999 and then took Olympic gold in Sydney in 2000, said that last season was "perhaps the worst of my career" and he had hinted in the spring that he would continue playing away from Barcelona.

However, he is now set to stay on at the Camp Nou, where his friend and old team-mate Luis Enrique has taken charge and is hoping to revive the club's fortunes after a season in which they failed to win any major trophies.

Barca's record all-time appearance holder with a CV that includes 25 trophies at club and international level was linked with a move to either the United States or Qatar before being persuaded by the new coach to stay put.

"I will give everything to carry on being important and useful to Barcelona," said Xavi, the local boy who still has two years to run on his contract at the Camp Nou.

Helping restore the Catalans to the summit of the game at home and in Europe will be the last big challenge of a career that has already delivered so much.