Barcelona suffered a second consecutive La Liga defeat to blow the title race wide open as Mikel Oyarzabal`s header handed Real Sociedad a 1-0 win over the European champions on Saturday.
Atletico Madrid are now only three points behind Barca after goals from the on-form Fernando Torres, Antoine Griezmann and Koke saw them come from behind to win 3-1 at Espanyol.
Cristiano Ronaldo also kept Real Madrid in the hunt a further point back in third with a goal and two assists in a 4-0 rout of Eibar.
Barca still need to drop points in two of their last six games thanks to their better head-to-head record with Atletico.
However, the pressure is now firmly on the Catalans after tasting defeat for the second time in a week after seeing a 39-game unbeaten run snapped by Real Madrid last weekend.
“It is an exciting and open league which the best team will win,” said Barca boss Luis Enrique.
“We played very badly in the first half. In football at this level against a team that defends like Real Sociedad defended we needed much more order, control and possession to do damage to the opponent.”
Barcelona have now not won in their last seven visits to Sociedad and lost each of their last four league meetings in San Sebastian.
Just as in last season`s 1-0 win under the tutelage of David Moyes, Sociedad made the perfect start as 18-year-old Oyarzabal soared to power home Xabi Prieto`s cross into the far corner.
Barca were without the suspended Luis Suarez and badly missed the 45-goal Uruguayan`s presence as they struggled to create clear-cut chances.
Luis Enrique had rested Andres Iniesta, Ivan Rakitic and Jordi Alba with one eye on the second leg of their Champions League quarter-final at Atletico on Wednesday.
However, all three were called upon as Barca chased the game after the break and Geronimo Rulli had to produce a brilliant save to prevent Iniesta`s left-footed drive finding the top corner.
Rulli came to Sociedad`s rescue once more to deny Messi his 500th career goal from close range moments later.
And Rulli saved from Messi and Iniesta once more late on to seal a three points celebrated as wildly in Madrid as by the home fans at Anoeta.
Real Madrid bounced back from their Champions League embarrassment against Wolfsburg in midweek despite coach Zinedine Zidane making eight changes as they look to overturn a 2-0 deficit against the Germans at the Santiago Bernabeu on Tuesday.
“I`m happy with the way we played, more in the first half than the second,” said Zidane.
“We know what awaits us and what we are playing for on Tuesday. Now we just have to rest and prepare well.”
Despite the changes, the hosts were always comfortable against the Basque minnows from the moment Rodriguez smashed home a sumptuous free-kick after just five minutes.