The Dutchman will not feature for the Liga champions in the upcoming four months after successfully going under the knife
The Netherlands international picked up the muscular problem during his loan spell at Schalke last term and has not featured in an official game since November 2012.
Afellay was widely expected to leave Barcelona before the end of the summer transfer window, but a transfer now no longer seems to be an option for the versatile midfielder.
"Ibahim Afellay underwent surgery this Thursday to correct the chronic tendino-muscular injury in his right thigh. Doctors Antoni Dalmau and Ricard Pruna conducted the surgery at Barcelona Hospital," a statement on the official Barcelona website reads.
"The player will be out of action for approximately four months."
The 27-year-old joined Barcelona from PSV in January 2011 and won the Champions League during his first six months at the club.
However, injuries have since prevented him from making an impact at Camp Nou.