Barcelona beat third-placed Getafe 2-1 at home on Saturday to stay on the heels of La Liga title rivals Real Madrid but the champions were made to sweat for all three points by the impressive visitors.
Antoine Griezmann sent the Catalans ahead in the 34th minute with a cool finish with the outside of his left foot after being played in by an outstanding pass from Lionel Messi, while Sergi Roberto doubled Barca's lead five minutes later.
Getafe pulled a goal back in the 66th with a stunning volley from striker Angel Rodriguez, who almost snatched an equaliser but was denied by Barca keeper Marc-Andre ter Stegen, who then flew to the floor to prevent Jaime Mata netting on the rebound.
The victory took Barcelona level on 52 points with Real Madrid, who lead the standings on goal difference and host Celta Vigo on Sunday. Getafe stay third on 42.
The unfashionable Madrid side, who are the youngest club in La Liga, have shaken up the top-flight this season with their intense and aggressive style and went to the Camp Nou on a run of four league wins in a row without conceding a goal.
There was addded intrigue due to a long-standing rivalry between Getafe coach Jose Bordalas and Barca's Quique Setien, who had clashed on several occasions in the past due to their opposing football philosophies.
Getafe's high-pressing caused the home side plenty of problems early on and they looked to have taken the lead through Allan Nyom only for the goal to be ruled out after video technology showed the defender had fouled Barca's Samuel Umtiti.
Barca's injury problems deepened when Jordi Alba left the pitch in tears in the first half after suffering a muscle injury which could keep him out of the Champions League match at Napoli and the title showdown away to Real Madrid on March 1.
But Barca grew into the game with the help of his replacement Junior Firpo, who laid on the pass from which Roberto scored their second after Griezmann had broken the deadlock by linking up superbly with Messi.
The quickfire goals were harsh on Getafe but the visitors hauled themselves back into contention through top scorer Rodriguez, who has been linked with a move to Barca as an emergency replacement for the injured Ousmane Dembele.
Getafe continued to cause problems for Barca's defence in the remaining minutes although the Catalans missed chances to rubber stamp their victory as Griezmann and Messi each missed the target.