There were four minutes left when Lionel Messi scored the goal that allowed Barcelona to depart the Vicente Calderón top of La Liga and believing they could actually win it. This was not a good game, but it was a very good result for Luis Enrique’s side on their last visit to this stadium, due to be bulldozed in the summer.

Although the occasion revealed the flaws in their football, and while Real Madrid were at that stage yet to kick off against Villarreal and still have a game in hand to play against Celta de Vigo, by the end of it Barcelona were top, for a few hours at least. How they got there is another question. The answer, as so often, was Messi.

This was not Messi’s best game and it certainly was not Barcelona’s, but there they were. And there he was. With the score at 1-1 in the 86th minute and the game heading towards a conclusion that suited no one, he clipped a free-kick into the Atlético area and followed it. When the ball came back to him, via Luis Suárez, Messi’s first shot was blocked but he reacted quickest to nudge the rebound past Jan Oblak from six yards. It hadn’t been the tidiest of goals and it wasn’t the tidiest of games. Barcelona did not convince, yet this was their 17th consecutive league match without defeat.

They were fortunate to win it. They opened the scoring when, after three rebounds, the ball dropped to Rafinha to score on 64 minutes. The lead was then cancelled out by Diego Godín’s near-post header six minutes later. Another free-kick had led to the third, via a rebound or two of its own. And that, in a way, was the portrait of the afternoon at the Calderón. Even before that goal Barcelona knew they would leave here top, on goal difference, but surely with the sensation that they could not possibly stay there. After it, the sensation shifted. They’re still standing, and ahead of everyone else.

On a slow pitch , the ball holding up, Atlético had been on top throughout the first half, alternating pressure and patience but always a step quicker than their opponents. Luis Enrique had opted for three central defenders but if he sought control or protection, he did not get it; instead he got a flat performance, lacking in presence or play.

Godín, Gabi and Antoine Griezmann all had shots inside 20 minutes. Barcelona were not finding a way out. Corners came and went, all at one end, none dealt with comfortably. Marc-André ter Stegen made a superb save from Griezmann and then cut out a cross from the Frenchman. He was up quickly and looking for the one outlet Barcelona seemed to have: Neymar, who allowed his team to breathe even when he ultimately lost the ball, which he often did. As the half closed, Barcelona had found a way into it, Oblak producing a superb save from a Messi free-kick and then denying Gerard Piqué, while the second-half continued in similar vein.

Suárez missed at one end, Griezmann at the other. And that, it seemed, was that. But three scrappy goals followed. Rafinha, then Godín, then Messi. There was still time for Piqué to hook one off Fernando Torres’s head, yards out. The chance had been created by a long throw. It had been that kind of match, but it could prove a significant one for Barcelona.