Lionel Messi scored twice on Saturday to help Barcelona rebound from back-to-back losses and go into the next round at Real Madrid within striking distance of the Spanish league leader.
Messi added an assist as Barcelona saw off a dangerous Real Sociedad side 3-2 at Camp Nou, with the defending champions struggling to end a run of defeats at Malaga in the league and Juventus in the Champions League.
Madrid needed two goals from Francisco "Isco" Alarcon, including his 90th-minute winner, to stay three points ahead of Barcelona at the top of the table after prevailing 3-2 at Sporting Gijon. Madrid also has a match in hand.
Before the fierce rivals meet next round, both will play the return legs of their Champions League quarterfinals. Madrid welcomes Bayern on Tuesday after winning the first leg 2-1, while Barcelona must overturn a 3-0 first-leg defeat to Juventus on Wednesday.
BARCELONA 3, REAL SOCIEDAD 2
Sociedad started strongly but it was Messi who struck first in the 17th with a sharply taken blast from outside the area that streaked into the lower corner of the net.
Messi then scrambled in the ball after Luis Suarez's shot was saved by Geronimo Rulli in the 37th, taking his league-leading tally to 29 goals.
Sociedad, however, didn't fade and got a goal back when Inigo Martinez's shot took deflections off Barcelona goalkeeper Marc-Andre ter Stegen and defender Samuel Umtiti before going in.
Messi passed for Paco Alcacer, starting for the suspended Neymar, to make it 3-1, only for Xabi Prieto to steer home Willian Jose's pass in first-half injury time.
Sociedad was the more aggressive side in the second half, which doesn't look good for Barcelona's chances of another stunning comeback in the Champions League against Juventus. In the Round of 16, Barcelona routed Paris Saint-Germain 6-1 to overhaul a 4-0 loss.
SPORTING GIJON 2, REAL MADRID 3
Madrid was on the verge of a second consecutive league draw when Isco drilled a right-footed shot from just outside the area between goalkeeper Ivan Cuellar and his post.
Isco's outstanding performance saved Madrid coach Zinedine Zidane from paying a heavy price for resting almost all his first-choice players, including Cristiano Ronaldo and Karim Benzema, for Madrid's big week ahead.
"Isco deserved this," said Marcelo, who went on as a second-half substitute for Madrid. "It was a relief to score at the end and take the three points. There is little time to rest and those who played today were phenomenal. They don't have many minutes, but that's what makes a team great. We need everyone and everyone responds."
Isco's first goal was a superb solo effort in the 17th to cancel out Duje Cop's opener for Sporting. The Spain midfielder avoided three defenders inside a crowded area before lashing a left-footed strike just inside the top corner of the goal frame.
Zidane said it was Isco's best match with Madrid, adding "you have to have character to do what he did."
Sporting went back ahead through a header by Mikel Vesga, who had already set up Cop's opener, shortly after halftime.
But Alvaro Morata headed Madrid level again in the 59th from a pass by Danilo, and the pacesetters kept pushing until Isco netted the winner.
After the match, Isco tried to quash rumors he's unhappy at the club.
"I have always been clear - I want to stay at Real Madrid for many years," Isco said. "I don't know why people are surprised when I say I want to play more."
ATLETICO MADRID 3, OSASUNA 0
Atletico Madrid rested forward Antoine Griezmann ahead of Tuesday's Champions League match at Leicester, when it will defend a 1-0 first-leg victory.
Yannick Carrasco struck twice and Filipe Luis added another goal as third-placed Atletico eased past bottom-side Osasuna.
Osasuna's Salvatore Sirigu saved two late penalties by Carrasco and Thomas Partey.
DEPORTIVO LA CORUNA 2, MALAGA 0
Deportivo moved away from the drop zone with its first win in five rounds.