Messi did not make it past half-time at the Nou Camp before suffering an abductor muscle injury during the first half of the LaLiga encounter.
Manager Ernesto Valverde said of Messi: "It's some discomfort in the abductor and so we didn't want to risk it."
Messi was making his return from a right calf injury which had kept him out of the Barcelona line-up since pre-season, but he only lasted 45 minutes.
Barcelona visit Getafe on Saturday before hosting Inter Milan in the Champions League and Valverde will want Messi available as Barcelona bid to make up for a slow start to the season.
A shock 2-0 defeat to Granada came before the 2-1 win over Villarreal which moved Barcelona up to fourth in the table.
Antoine Griezmann and Arthur scored for the home side with Santi Cazorla replying for the visitors.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies