Barcelona needed a late winner from Arturo Vidal to beat bottom-club Leganes 2-1 on Saturday and dig out a much-needed victory ahead of what could prove a crucial month in their season. Vidal poked in a fortuitous goal in the 79th minute at Butarque after Luis Suarez headed home a Lionel Messi free-kick to cancel out a brilliant opener from Leganes forward Youssef En-Nesyri. Barcelona stay top of the table, three points above Real Madrid, who play later on Saturday at home to La Liga’s surprise high-fliers Real Sociedad.

A gritty win will also come as a relief to under-pressure coach Ernesto Valverde, whose team now turn their attention to Wednesday’s crunch Champions League group game against Borussia Dortmund at Camp Nou.

A goalless draw against Slavia Prague earlier this month means Barca’s qualification from Group F is no longer guaranteed.

After Dortmund, they then play away at Atletico Madrid in La Liga to start a month that will include trips to Inter Milan in the Champions League and Real Sociedad in La Liga before the season’s first Clasico at home to Real Madrid.

It was important therefore to avoid a slip against Leganes, playing their first game in front of their own fans since appointing Javier Aguirre as coach.

The home side made the perfect start as En-Nesyri beat Gerard Pique with a wonderful early striker.

Pique has spent the international break juggling football with the Davis Cup, the revamped tennis tournament in Madrid that he is organising through his marketing company Kosmos.

Doubts about the defender’s focus would not have been allayed in the opening quarter of an hour.

One pass from Roque Mesa was enough to set En-Nesyri free against the 32-year-old in the 12th minute.