Barcelona defender Carles Puyol is set to undergo knee surgery, ruling him out of Spain's title defense at the European Championship .

Puyol felt discomfort in his right knee in Barcelona's 4-0 victory over Espanyol last Saturday, and medical tests have led the 34-year-old to opt for an arthroscopic operation.

Barcelona said on Tuesday that the surgery will be performed on Saturday and Puyol will need six weeks to recover, hurting Spain's defensive options for the June 8 to July 1 tournament in Poland and Ukraine. Puyol will also miss the Copa del Rey final on May 25, when Barcelona plays Athletic Bilbao.

''His absence leaves us without such an important player,'' coach Vicente del Bosque told Spanish sports daily Marca. ''He was playing great at this moment, too. A great shame.''

Puyol missed most of last season after having surgery on his left knee. The Barcelona captain recovered and was a regular in the club's lineup throughout this campaign.

He played in all the matches as Spain won Euro 2008 in Austria and Switzerland and followed that up by winning the World Cup in South Africa two years later.

Puyol has 99 caps and has played for Spain at all major championships since the 2002 World Cup.

Spain's first match in Group C at Euro 2012 is on June 10 against Italy. The team was also drawn with Ireland and Croatia.