Substitute Arturo Vidal rescued Barcelona with a scrappy late goal as the leader of LaLiga recovered from an early setback to win 2-1 at bottom side Leganes on Saturday.
Barca boss Ernesto Valverde fielded an attacking line-up that included Lionel Messi, Antoine Griezmann, Luis Suarez and Ousmane Dembele in a 4-2-3-1 formation, but it did not look like paying off for large parts.
Leganes has won just once all season but the underdogs took the lead through Youssef En-Nesyri's sublime early strike, before the champion hit back in the second half.
Suarez dragged his side back on level terms and Vidal scored in fortuitous fashion 11 minutes from time to move Barca three points clear at the summit, the winning goal allowed to stand after a VAR check showed the midfielder was not offside due to the ball reaching him via a Leganes player.
Barcelona lost 2-1 at Leganes last season and was behind inside 12 minutes on this latest trip, En-Nesyri cutting inside on his left and curling the ball into the top-left corner.
Suarez wasted a couple of promising opportunities before forcing an excellent fingertip save from Ivan Cuellar with a header from Dembele's cross.
But the Uruguay international found a way through eight minutes into the second half after being left free on the edge of the six-yard box to head in Messi's free-kick.
Barcelona took control of the contest but was left frustrated until Vidal struck 22 minutes after being introduced from the bench.
Vidal was left in space to bundle the ball past Cuellar from close range after Dembele's corner deflected into his path, the touch off the leg of Ruben Perez ensuring the goalscorer was onside despite Leganes' protests.
What does it mean? Barca extend lead after surviving scare
Barcelona had collected seven points from a possible 18 on its travels in LaLiga this term ahead of this trip to the Spanish capital. Vidal's late strike makes it three away wins in its last four matches, however, and ensures that Real Madrid, Atletico Madrid, Sevilla and Real Sociedad remain at arm's length.
Vidal proves his worth to Valverde
Vidal admitted last month he is not happy with his lack of starts at Barcelona and he was again named among the substitutes for this match. However, the Chile international perhaps proved a point to head coach Valverde with his late winner, which makes it four goals in nine LaLiga appearances this season.
Busquets ban a blow for Barca
Sergio Busquets was booked for a foul on Roque Mesa in the first half and will now miss next weekend's trip to Atletico Madrid after accumulating five yellows this season. Without the defensive midfielder in their starting line-up, Barca have already lost to Athletic Bilbao, Granada and Levante this term. Valverde has a week to find a solution.
Barcelona can secure a place in the last 16 of the Champions League with victory at home to Borussia Dortmund on Wednesday. Valverde's men return to league action with a huge clash against Atletico Madrid next Sunday, the same day that Leganes travels to Sevilla.
- WI vs ENG Live Streaming Info, 1st ODI: When and where to watch England tour of West Indies 2023-24?
- NBA roundup: Clippers stuns Warriors after trailing by 22
- Vijay Hazare Trophy LIVE Score, Round 6: Karnataka 143 all out vs Haryana; Punjab records big win
- Vijay Hazare Trophy 2023: Punjab thrashes Nagaland to record biggest win in Indian List A cricket
- Girona not title race level, should enjoy ‘historic’ La Liga form, says coach Michel