The Barcelona captain Carles Puyol has announced he will be leaving the Spanish champions at the end of the season following a persistent battle with a knee injury. The 35-year-old Spain international had a contract with Barça until 2016 but has reached an agreement with the club to rescind the final two years of the deal.

Puyol, who has spent his entire career at Barcelona and made his first-team debut in 1999, said: “I want to announce that at the end of the season I will no longer be a Barcelona player.”

A fans’ favourite for his battling displays, Puyol has been restricted to just five league games this season. He has the second highest number of appearances for the club with 593, only bettered by Xavi Hernández.

“”I have told the club the situation and we are both in agreement that it is the right decision. I will rescind the two years left on my contract,” Puyol added. “The injuries I have been suffering from have been worse than I expected and have not allowed me to play at my level.

“It is not finished today, there are three months of the championship left where those that know me are aware that I will not take it easy and I will fight to the end to try and help the team achieve their objectives this season.”

Puyol came through the Barcelona youth system, La Masia, and was given his debut under the coach Louis van Gaal. He has been club captain for the past 10 years, but has been restricted in the past two seasons by knee injuries.

He has won 21 titles at the club and captained the famed “six cups” side of 2009 that won all the competitions open to them during that calendar year.

With Spain he won Euro 2008 and the 2010 World Cup but injury cost him a place in the victorious Euro 2012 squad.

The Spanish media have reported the Catalan could continue his career at a less-demanding level, such as Major League Soccer, but he has yet to give any hint of his next move. “I don’t know what I will do after 30 June – what I am sure about is that after the season I will need to rest,” Puyol added. “I have had four years without a break due to injuries. After that we will see.”