Two goals in the final three minutes earned Barcelona a dramatic victory away at second-from-bottom Rayo Vallecano on Saturday night.
A double from Luis Suarez and strike from substitute Ousmane Dembele ensured Ernesto Valverde’s men, who were second best for large periods of the game, escaped with three points.
Jose Angel Pozo and Alvaro Garcia struck for the hosts to give them a deserved 2-1 lead and despite appearing comfortable going into the closing stages, were undone by the Catalan giants.
Suarez had opened the scoring for the Spanish champions in the tenth minute, firing home from point-blank range after Jordi Alba’s cutback.
However, Pozo fired the hosts deservedly level ten minutes from half-time, turning expertly on the edge of the area and smashing a rasping effort past Barca goalkeeper Marc-Andre Ter Stegen.
Former Manchester City midfielder Pozo had missed a sitter five minutes earlier, firing wide when the goal was at his mercy.
Rayo managed to contain Barca since falling behind although Suarez came within inches of restoring the visitors lead just before the break, with his first-time effort rattling the post.
Barca were lethargic with a trio of substitutions entering the fray before the hour mark with Dembele, Arturo Vidal and Munir El Haddadi all introduced.
However, it was substitute Garcia for Rayo who made the crucial difference – scoring with his first touch of the game after replacing Oscar Trejo.
The former Cadiz player netted from close-range after an initial header had rebounded back off the post to stun the visitors.
The hosts went on to spurn a number of opportunities including two efforts from Giannelli Imbula – firstly seeing an effort fly narrowl wide and another saved by Marc-Andre Ter Stegen.
But two late goals from the visitors – a controlled Dembele half-volley and late Suarez finish, ensured they extended their advantage at the top of La Liga.
Rayo Vallecano XI: García; Advíncula, Amat, Gálvez, Moreno; Imbula, Santi, Trejo; De Tomas, Pozo, Embarba
Rayo Vallecano subs: Dimitrievski, Ba, Velazquez, Garcia, Alegria, Kakuta, Bebe
Barcelona XI: Ter Stegen; Sergi Roberto, Pique, Lenglet, Alba; Busquets, Arthur, Rakitic; Rafinha, Suárez, Coutinho
Barcelona subs: Cillessen, Semedo, Dembélé, Munir, Vidal, Alenya, Chumi
Venue: Estadio de Vallecas, Madrid, Spain
Referee: Alejandro José Hernández Hernández