Barca needed to avoid dropping points against Osasuna on Thursday to stand any chance of keeping their title hopes alive, with Madrid only needing a win to become champions for the first time for three seasons.
However, Barca - champions in each of the previous two campaigns - went down 2-1 to 10-man Osasuna at Camp Nou, albeit Madrid's victory over Villarreal by the same scoreline would have ensured Los Blancos clinched the title regardless.
And Barca superstar Messi, who cancelled out Jose Arnaiz's opener with a typically exquisite free-kick before Roberto Torres' stoppage-time winner for Osasuna, acknowledged his side have been second best over the course of the campaign.
"We've been pushing all season but we've been inconsistent all season too," Messi told Movistar.
"Today it wasn't easy to find a way through to beat the goalkeeper. I don't think we should have lost but we knew what type of game this was going to be and we knew we'd have to remain patient to find a way through.
"I think Real Madrid did what they had to do. They've done very well since the break in play. Of course, we've had a lot of injuries and many points that we've dropped in games that we shouldn't have and now we have to be self-critical over the summer and look back at the mistakes we've made.
"Looking back over the course of the season, of course Madrid deserve it. We have to look back at ourselves and work out where we went wrong rather than looking at the other teams.
"It's difficult if you play in the way we played here today to win the title."