Barcelona slumped to their first defeat of the season as Leganes' second-half salvo secured them a shock 2-1 win on Wednesday.
Goals from Nabil El Zhar and Real Madrid loanee Oscar Rodriguez lifted Leganes off the bottom of La Liga and ensured Philippe Coutinho's wonder strike papered over another below-par Barca performance.
Thomas Vermaelen and Munir El Haddadi were surprise inclusions in the champions’ XI against a Leganes side who had yet to win a game under Mauricio Pellegrino.
Barca made a dream start when Messi teed up Coutinho, who slammed a first-time volley into Ivan Cuellar’s bottom-right corner, before the No 10 crashed a curler on to the crossbar.
However, Lega responded by pressing high in a bid to unsettle the Catalans, and Marc-Andre ter Stegen was forced to palm away a deep Juanfran Moreno cross-shot, which threatened to lob him at his far post.
Heartened by holding their own against the Blaugrana, the game turned 360° in the space of two, second-half minutes.
First, El Zhar headed in a looping cross from the left, before another long ball caught out Barca’s high line, which Gerard Pique made a mess of, his hooked clearance gifting Oscar the winner.
Ernesto Valverde threw on Luis Suarez, Malcom and Jordi Alba, but none of the trio could conjure up even the hint of an equaliser.
Instead, Ivan Cuellar was on hand to keep all three points at Butarque as he pushed away Coutinho’s strike, before denying Sergio Busquets on the rebound.
Leganes 2-1 Barcelona
El Zhar 52, Oscar 53 (L) Coutinho 12 (B)
Leganes: Cuellar; Juanfran, Bustinza, Tarin, Jonathan Silva; Carnero, Ruben Perez, Vesga (Sabin 82); El Zhar (Nyom 86), En-Nesyri, Oscar (Gumbau 74)
Barcelona: Ter Stegen; Sergi Roberto, Pique, Umtiti, Vermaelen (Alba 70); Rakitic, Busquets, Coutinho; Messi, Munir (Suarez 61), Dembele (Malcom 71)
Referee: Undiano Mallenco