Lionel Messi came off the bench to transform a sluggish Barcelona, but could only draw with Athletic Bilbao, while Real Madrid came from behind to win the derby against Atletico.

Behind at half-time to Markel Susaeta’s 20th-minute opener at San Mames, Barca introduced Messi just before the hour and the substitute equalised with fine solo effort, jinking past three Athletic players before stroking the ball into the bottom-left corner. Alexis Sanchez quickly gave the Catalans the lead, but Ander Herrera levelled late on.

Colombian striker Radamel Falcao gave the hosts an early lead at the Vicente Calderon, but Juanfran diverted Angel di Maria’s free-kick past his own keeper to quickly level matters. Di Maria struck the winner in the second half to take the city bragging rights and close the gap behind Barca to 11 points, delaying Tito Vilanova’s men’s celebrations.

Real Sociedad maintained their challenge for Champions League football by defeating rivals Valencia 4-2 at Anoeta. Roberto Soldado headed the visitors into a 25th-minute lead, but Inigo Martinez levelled before Gonzalo Castro and Imanol Agirretxe put the hosts in charge. Jonas pulled one back late on for Los Che, but Agirretxe grabbed his second in added time to rubber-stamp an emphatic win for the Basques.

Sociedad’s victory meant they maintained a five-point advantage over both Valencia and Malaga, the latter having goals from Roque Santa Cruz and defender Weligton to thank for a 2-1 win against Getafe, whose late consolation came from Juan Valera.

Deportivo La Coruna stretched their unbeaten run to six matches, but are only a point clear of the relegation zone after drawing 1-1 at Real Betis, who remain seventh. Depor’s top scorer Riki gave the Galicians the lead after just seven minutes and resisted pressure from Betis until Jorge Molina fired home from outside the penalty area.

Betis’ city rivals Sevilla also drew 1-1, away at Real Valladolid. Alvaro Negredo’s second half goal from the penalty spot, cancelling out Javi Guerra’s opener for the hosts, was his 19th of the season.

Osasuna also eased their relegation fears with a 2-2 draw at Rayo Vallecano. Andrija Delibasic put the host ahead after six minutes with Raoul Loe replying for Osasuna two minutes later. Alejandro Arribas then gave the Pamplona outfit the lead before Piti’s second half equaliser ensured the points were shared.

Celta Vigo improved their chances of avoiding the drop with a slender win against Levante, thanks to Augusto Fernandez’s first-half effort, while Granada moved two points clear of the danger zone with a 1-0 victory at Espanyol, courtesy of Nolito’s 37th minute goal.

An exciting basement scrap at La Romareda saw Real Zaragoza come out on top with a late 3-2 victory against Mallorca. Paco Montanes’ 29th minute strike for the home side cancelled out Tomar Hemed’s opener for the islanders. Helder Postiga restored Zaragoza’s lead on the hour, only for Angel Arizmendi to hit Mallorca’s second equaliser with eight minutes remaining. A draw looked likely until Ruben Rochina’s winner two minutes from time left Mallorca bottom of La Liga.