Arturo Vidal scored a scruffy late winner as La Liga leaders Barcelona came from behind to beat bottom club Leganes.
Youssef En-Nesyri’s stunning early strike put Leganes ahead while Barcelona toiled in response.
The champions improved after the break and Luis Suarez equalised with a clinical header from a Lionel Messi’s spectacular free kick.
Vidal’s controversial finish put the leaders three points clear of rivals Real Madrid, who play Real Sociedad later in the day.
The victory ensured the Catalonia club survived another away day defeat.