Real Madrid had previously been the only side to take a point from the Catalans this season but Sociedad went one better as they heroically came from two goals down to claim a memorable win.

Barca appeared to be heading for their 19th win of the year when Lionel Messi scored after seven minutes before Pedro doubled the visitors' advantage with 25 minutes on the clock.

But Sociedad gave themselves a chance when Chori Castro scored just before the halftime break and when Barcelona defender Gerard Pique received his second yellow card after tripping Carlos Vela on 56 minutes the home side began to press for an equaliser.

They soon found it six minutes later courtesy of a Javier Mascherano own goal after the Argentine was unable to get out of the way of a Chori shot and with a partisan home crowd behind them an unlikely Sociedad victory became a real possibility.

Barcelona defended resolutely as the clock wound down but Sociedad eventually found the winner in injury time when Imanol Agirretxe met a Carlos Martinez cross to seal the most surprising result of the La Liga season.

Meanwhile, Malaga missed the chance to move into fourth place on the table after they were held to a 1-1 draw by Celta de Vigo.

Martin Demichelis put the home side ahead on 37 minutes but Manuel Pellegrini's side were unable to keep their opponents at bay as Augusto Fernandez levelled the scores with 14 minutes remaining to earn Celta de Vigo a vital point as they attempt to avoid relegation.

In the day's other matches, Granada belied their position on the table as they stunned Rayo Vallecano 2-0 while Getafe and Sevilla played out a 1-1 draw.