Barcelona went 10 points clear at the top of La Liga for a few hours at least after beating struggling Valencia.
Raphinha put Xavi’s side into the lead with a header from Sergio Busquets’ dinked ball over the top.
They looked set to take control of the game when they won a penalty in the second half but Ferran Torres hit the post against his old team.
Ansu Fati struck the woodwork a minute later and Barcelona ended with 10 men after Ronald Araujo was sent off.
The Barca defender was shown a straight red card for a professional foul on Hugo Duro, who was running on to Jules Kounde’s poor header.
Barcelona goalkeeper Marc-Andre ter Stegen kept his 18th clean sheet in 24 La Liga games this season and only had to make one save, keeping out Justin Kluivert’s 20-yard strike with seconds left.
Real Madrid can reduce the gap to seven points again when they visit fifth-placed Real Betis at 20:00 GMT.
Barcelona were without their three top scorers Robert Lewandowski, Ousmane Dembele and Pedri through injury, while boss Xavi was watching from the stands as he served a touchline ban.
Valencia remain in the relegation zone after the defeat.