Dembele's absence also means he will be sidelined for the rest of this season for Barca, who will be without another attacker after losing Luis Suarez to a long-term knee injury last month.
"The first team player Ousmane Dembele has successfully undergone surgery ... for a ruptured tendon in his proximal hamstring in his right thigh. The Frenchman will be out for around six months," the La Liga champions said in a statement.
Barcelona lose Suarez for key four months after knee surgery
The 22-year-old has suffered a number of hamstring problems since joining from Borussia Dortmund in August 2017 in a deal worth up to 147 million euros ($160.5 million).
Dembele has made only nine appearances this season.
He was close to recovering from a hamstring injury sustained in November before suffering a relapse in training last week.
The former Rennes attacker also missed the majority of his opening year at Barcelona with a similar problem which kept the forward out for four months.
Dembele's latest disappointment is a blow to France's hopes of following up 2018's World Cup triumph by winning the Euros this summer, while Barca coach Quique Setien spoke earlier this month of his excitement at the prospect of the youngster's return.
Barca considering signing a striker: Setien
His long layoff could prompt Barcelona to buy a replacement up front, if the club are allowed to make an emergency signing by the Spanish Football Federation (RFEF).
Barcelona can apply for permission from the RFEF but any new arrival would have to be playing in La Liga or out of contract, and would not be allowed to feature in the Champions League.
Real Sociedad forward Willian Jose, Getafe's Angel and Lucas Perez from Alaves are all reported targets.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ