The four-time world player of the year limped off at half-time during Tuesday's 2-2 draw, prompting worries he had suffered a torn muscle that would end his season early.
He is certain to miss Saturday's Primera Liga clash with Mallorca but could yet feature in the return leg against Carlo Ancelotti's side at the Nou Camp on 10 April.
"The club's medical services have revealed that Leo Messi's hamstring injury will definitely rule him out of this weekend's game against Mallorca, whilst his availability after that will depend on how the injury progresses," read a statement on Barcelona's website.
"The Barca number 10 felt a twinge in his right hamstring towards the end of the first half last night."
Messi also confirmed the injury was less serious than first thought in a statement posted on his official Facebook page on Wednesday.
"I will return soon," he said. "Thankfully it was not so serious."
Messi's absence against Mallorca brings an end to his incredible 19-game scoring streak in La Liga.
He became the first player to score against every other team in La Liga consecutively when he netted in a 2-2 draw against Celta Vigo at the weekend.