Both sides opened the game brightly in the Madrid sunshine, with a crowded midfield the chief reason why chance creation was at a premium during the early stages.
On 11 minutes, Youssef En-Nesyri’s left-footed strike put the hosts ahead, but Barça continued on the front foot and Luis Suárez almost levelled 10 minutes later. It was the Uruguayan who came closest again on the half-hour, Leganés keeper, Cuéllar, having to go full-length to tip an intelligent header around the post.
Only dogged defence from the home side stopped the visitors from getting on the score sheet before the break.
Within 30 seconds of the re-start, Gerard Piqué’s header came back off of the post, as the Blaugrana exerted more pressure on their opponents.
That paid off on 53 minutes, a wonderfully flighted free-kick from Lionel Messi finding Suárez who powered a header home from inside the six-yard box.
The pendulum had swung and as Los Pepineros began to tire, Arturo Vidal was in the right place at the right time to hit the winner into the roof of the net with 10 to play.