(Adds details, quotes)
The 35-year-old defender, a fans' favourite for his battling displays, has been restricted to just five league games this season and has decided to end his time at the Nou Camp.
Puyol, who made his Barca debut in 1999, has the second highest number of appearances for the club with 593, only bettered by Xavi Hernandez.
"I will leave FC Barcelona at the end of the season," he told a news conference.
"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.
"The injuries I have been suffering from have been worse than I expected and have not allowed me to play at my level."
He added: "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 coach Louis van Gaal.
He has been club captain for the past 10 years, but has been restricted in the last 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.
Spanish media have reported the Catalan could continue his playing 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 June 30, what I am sure about is that after the season I will need to rest," he added. "I have had four years without a break due to injuries. After that we will see." (Reporting by Tim Hanlon, editing by Ed Osmond and Toby Davis)
- Sports & Recreation
- Carles Puyol
- FC Barcelona
- knee injuries