Ivan Rakitic nodded Barca ahead in the 41st minute but the home side lost control after the break following an injury to midfield lynchpin Sergio Busquets and Angel Corrrea fired in the equaliser in the 61st, shortly after Messi had come off.
“Leo Messi has torn the groin muscle in his right leg. He will be out of action for approximately three weeks,” Barcelona officials said in a statement.
Earlier on Wednesday, Real’s 100 percent start to the season came to an end as they drew 1-1 at home to Villarreal, also halting their joint record run of 16 straight league wins.
Captain Bruno Soriano gave Villarreal the lead on the stroke of halftime with a boldly chipped penalty after Sergio Ramos had handled in the area, although the Real captain made amends by heading in the equaliser in the 48th minute.
Real remain top of La Liga on 13 points but failed to seal a new record of consecutive wins, having equalled the 16 straight victories set by Pep Guardiola’s Barcelona in 2010/11 on Sunday.
“We were the much better side in the second half but you can’t always win every game in the last minute,” Zidane told a news conference on Wednesday.
“It’s difficult, it was a tough game and we gave a lot but sometimes these results happen. It happened today but it’s not going to change how we want to play.”
Cristiano Ronaldo spurned two early chances in a lacklustre half by Real, who allowed Villarreal opportunities at the other end.
Zidane’s side suffered a setback when Marcelo was forced off injured shortly before halftime but that was not the end of their woes.
Villarreal found their way through when Ramos gave away a penalty by halting a Manu Trigueros shot with his hand, and tried to hide his guilt by burying his face in his hands.
Soriano, who had missed from the spot against Malaga earlier in the season, opened the scoring with an audacious chip.
The Spain captain, however, redeemed himself by heading in Toni Kroos’ corner early in the second half.
From then on Real dominated proceedings as they searched for a winner, but despite chances falling the way of Gareth Bale, Ronaldo and Alvaro Morata, the European champions failed to break down Villarreal.