The Argentine World Player of the Year asked to be taken off with 20 minutes remaining at the Calderon, leaving his side with 10 men after coach Tito Vilanova had made all his substitutions.
The newly crowned champions came back from a goal down to win in his absence.
"He left the pitch because he was bothered in the same area that has affected him recently. He felt a strange sensation," Vilanova told the post-match news conference.
"We will find out tomorrow whether he will be out for days or weeks."
Messi damaged his hamstring against Paris St Germain in the Champions League quarter-finals last month and has failed to make a full recovery since then making mainly substitute appearances, if at all.
"Although it might seem difficult to understand how we are managing Lionel's injury, it isn't easy," Vilanova added.
"He has never felt completely recovered and we have gone with how he feels. He was fine before the game and trained normally during the week. He didn't feel anything while playing until he felt a pain again."
The 25-year-old has scored 46 league goals this season and is just four short of matching last season's record-breaking tally.
Barca still have the chance to match Real's record-breaking total of 100 points for a season set by Jose Mourinho's side last year.
The Catalans have 91 points with three games left to play at home to Real Valladolid and Malaga, and away to city rivals Espanyol.
(Reporting by Mark Elkington; Editing by John Mehaffey)