The Argentina international was forced off just before the half-hour mark in Barcelona's 2-0 win at Estadio de los Juegos Mediterraneos having given the champions the lead in the 21st minute.
The win meant that the champions picked up their seventh straight La Liga victory, a new club record for a start to the season, after Adriano Correia clinched the triumph in the second half.
But the victory was overshadowed by Messi's withdrawal, with the playmaker now a serious doubt for the Catalan giants' UEFA Champions League clash against Celtic on Tuesday.
A club statement said: "Leo Messi picked up an injury during the match against Almeria this afternoon (Saturday).
"The FC Barcelona forward sustained an injury to the biceps femoris in his right thigh and he will undergo additional tests on Sunday to determine the severity of his injury."
Coach Gerardo Martino was otherwise delighted to see his side break the record for their best-ever start to a season, but he was quick to highlight the importance of his players.
He said: "These players are going from record to record for years now, I'm just joining in."
Martino also clarified the decision to drop in-form Neymar, after the Brazilian spent the entire 90 minutes on the bench, insisting that the close-season signings was always going to be rested.
He added: "The plan was that he (Neymar) didn't play and in the end we didn't change it, even when Messi got injured."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.