Sergio Busquets scored the winner in the fourth minute of stoppage time as Barcelona closed the gap on Real Madrid by beating Valencia 1-0 at the Mestalla.
Despite seeing their passing rhythm disrupted by the hosts early on, Barcelona created the first chance of the evening when Neymar crossed for Luis Suarez, whose effort was tipped past the post by Diego Alves.
Valencia were making it difficult for the likes of Neymar and Suarez to get involved on a regular basis, and they threatened at the other end when Alvaro Negredo hit a shot straight at Claudio Bravo.
The best two chances of the first half fell to Valencia, but they missed the opportunity to take the lead when Andre Gomes twice fired past the post from the edge of the box.
After taking time to find their form early in the second half, Barcelona missed a brilliant chance to break the deadlock when Suarez dragged the ball wide of the post after evading a stranded Alves in the box.
Valencia came close to punishing Luis Enrique's side moments later when Rodrigo watched Gerard Pique respond impressively to clear his low strike off the line.
Barcelona were then dealt a cruel blow when a goal from Suarez was disallowed, despite the Uruguayan being in an onside position when the cross was delivered by Dani Alves.
The visitors continued to look vulnerable at the back, and they were fortunate to remain on level terms as Sofiane Feghouli hit a great opportunity straight at the relieved Bravo, who came to his side's rescue again to keep out Negredo's powerful strike.
Valencia would eventually drop deeper to frustrate Barcelona, who finally made the breakthrough with one of the final kicks of the match when Busquets tapped home after Alves had pulled off an impressive save to deny Neymar.