Barcelona: Barcelona captain Carles Puyol, 35, announced on Tuesday that he will leave the club at the end of the season after a decorated 15-year career at the Camp Nou.
Puyol, who did not reveal whether he will continue playing elsewhere, has been plagued by injuries over the last couple of seasons and has undergone three knee operations.
"At the end of the season I will leave FC Barcelona. The club are aware of this and we are in agreement," he said.
"We will rescind the final two years of my contract that were still to run."
Puyol signed a new deal with the club in January last year, but admitted in June that he would not stay if injuries continued to prevent him from playing a significant part on the field.
And having featured just 10 times this season in all competitions, he said it was time for a new challenge in a less physically demanding environment.
"After the last two operations it has been difficult for me to recover the level I need to be able to continue here, more than I expected and more than surgeons said. That is why I have taken this decision."
Puyol didn't reveal where he would go at the end of the current campaign and insisted he will give everything in what remains of the season to help Barca succeed on three fronts.
"I am not leaving today, there are still three months of the season remaining and those that know me know that I will not give up until the end. I will continue fighting to help the team improve and achieve our objectives this season.
"I don't know what I will do on June 30. What I do know is that I will need time to rest. I have had four years without a break due to the injuries. That is what I will do and then we will see."
The announcement brings to an end an extraordinary career in the Barcelona first team that began in 1999. Puyol is the club's second most decorated player of all-time, behind only teammate Xavi Hernandez, having made 593 appearances.
After beginning life as a right-back, he was converted into one of the most successful centre-backs in world football over the past decade as he won three Champions Leagues and six La Liga titles with his boyhood club.
He was also a key part of the Spanish sides that won the European Championship in 2008 and the country's first World Cup in 2010, memorably heading home the goal that took his side to the final in South Africa with a 1-0 win over Germany.
"Carles is an example for everyone on and off the field," Spain coach Vicente del Bosque said on Tuesday.
In total he has represented Spain 100 times with his last appearance coming in a 3-1 friendly win over Uruguay in February 2013, making him one of only eight players to have won a century of caps with La Roja.
"He is a natural leader, a person that when you hear his name you think of Barcelona," added former Barca midfielder Thiago Alcantara, now of Bayern Munich.
"In the time I was there he was a reference on an off the pitch. Everyone knows him and whilst Puyol is in the world of football, he will be an example for everyone."