Villa, 30, was carried off on a stretcher six minutes before half-time at International Stadium Yokohama after appearing to land awkwardly and was taken to hospital for tests.
Barcelona confirmed that Spain's all-time record scorer had "suffered a fracture to the tibia in his left leg" and is likely to miss the majority of Barca's Primera Division and Champions League campaigns, but could be available to world and European champions Spain for Euro 2012, which begins in June.
A statement from Barcelona read: "In the coming hours, Villa will return to Barcelona, via Frankfurt, to be operated on. He will be accompanied by doctor Ricard Pruna and Manel Estiarte. The approximate time he will be sidelined is between four and five months.''
Head coach Pep Guardiola said after the match: "He will now travel to Barcelona as soon as possible. He will be greatly missed as a colleague and as a player. I hope everything goes well.
"He will be a long time. It's a big blow to the team. We just hope that he can play again as soon as possible.
"David is very dear to us. The injury has saddened us all. Everyone can put themselves in his place and know how they would suffer if it happened to them. They feel for him. We must accept it and encourage him in his recovery.''
Guardiola insisted now was not the time to discuss January reinforcements in the light of Villa's absence.
"Let us have compassion and respect,'' he said. "Let's give it time. Now is not the time to talk about it.''
The blow follows a report on Wednesday in Marca that claimed Villa could leave Barca in the January transfer window as the striker has started only half of his side's La Liga matches this season.
Guardiola moved to reject the rumour, branding it as a "lie", and defended his decision to leave Villa on the bench for their El Clasico victory over Real Madrid at the weekend.
Villa has scored five times in 15 league matches this season, following on from his 18 goals in 34 games as Barca won the league title last term. He has made 75 appearances for the club in all competitions, scoring 32 goals.