Cristiano Ronaldo scored twice as Real Madrid marked Jose Mourinho's 100th match in charge by opening up a 13-point lead with a 3-2 win over Real Betis on Saturday, their 11th victory in succession.
But it was a tough night for Mourinho's men who had to come from behind before they could celebrate a 21st victory in 22 games.
Jorge Molina scored after nine minutes for Betis before Gonzalo Higuain drew Real level.
La Liga's top-scorer Ronaldo then put Madrid ahead after the break. Betis refused to roll over and Jefferson Montero equalised before Ronaldo secured the win with his 32nd goal of the season after 72 minutes.
"It was a game in which neither side was in control and so you didn't know who was going to win. At times it is better to be more defensive," said Mourinho.
"The game was full of bad passes and so perfect for counter-attacking. I think that a draw would have been a fairer result but it could have finished 2-4 or 4-4 easily.
"Betis aren't a big team but they play exciting football for people to enjoy and the attitude of their coach (Pepe Mel) is fantastic."
Ronaldo had a shot saved by the keeper in the opening exchanges but Betis went ahead from a counter-attack with Ruben Castro's defence-splitting pass setting up Molina who fired home past helpless goalkeeper Iker Casillas.
Betis have impressed with their adventurous football since their return to the top flight and made life hard for Real who struggled to take control of the game and appeared uncomfortable against the pace of the home side.
Real responded with their first clearcut chance with Mesut Ozil lofting the ball over the defence for Higuain to run onto and the Argentine finished clinically.
Before half-time, Salva Sevilla hit the crossbar with a free-kick for Betis while Higuain and Ronaldo also went close with openings at the other end.
Real looked like they had asserted their authority on the match with Ronaldo spinning and slotting the ball home after 51 minutes but minutes later Betis were level.
The visitors failed to clear a corner and Montero, who had been a threat all game, pounced with a drive from the edge of the area.
Both sides pressed forward and Montero had a strike well saved by Casillas while, at the other end, Marcelo was denied by Betis keeper Fabricio Agosto.
Ronaldo restored Real's lead when he was quickest to react inside the area after Agosto parried a Sergio Ramos header.
Barcelona will look to reduce the deficit on Sunday when they play away to Racing Santander.
Newly-rich Malaga leapfrogged Levante into fourth place with a Jose Rondon header giving them a 1-0 victory over the modest side from Valencia.
Levante, with the lowest budget in the league, have been a major surprise this season as they are more used to fighting around the lower reaches of the league.
But they have now been overtaken in the league table by Malaga who have been bank rolled by Qatari Sheikh Abdullah bin Nasser al-Thani and spent heavily on new players last summer.
Malaga dominated the opening stages of the game but lacked a cutting edge while Levante could have stolen a lead on the counterattack by Abdelkader Ghezzal.
After the break, chances began to appear at either end and Joaquin Sanchez had a strike well saved by the keeper before shortly afterwards he laid on the pass from a free-kick for Rondon to head the ball into the corner after 51 minutes.
Arouna Kone went within inches of equalising with a toe poke past the keeper but Malaga should have extended their lead through excellent openings for Rondon and Isco Alarcon.
At the other end of the table, bottom side Zaragoza's problems increased as they were beaten 3-0 by Real Sociedad but Sporting Gijon moved to within three points of safety with a 1-0 victory over Sevilla.