Long after the final whistle had gone here, Club Brugge’s fans were still singing high in the north stand, their players back out on the pitch celebrating with them. This was a big occasion and a big result for the Belgians and yet, while there were no signs of regret, they knew it could have been even bigger. For most of a night their coach, Philippe Clement, described as “historic” they had led with two goals from Emmanuel Bonaventure, but headers from Sergio Ramos and Casemiro, the latter in the 86th minute, had seen it end level.

The rest of the stadium stood empty, Madrid’s fans making their way home knowing that it could have been worse: for them too, this finishing 2-2 was a success, given where they had come from.

Tottenham Hotspur v Bayern Munich: Champions League – live! Read more

What Madrid might have expected to be a routine victory became a rescue mission. For a long time, they had been on course for a second defeat in the Champions League that arrived in a way that could have hurt even more than the first: to begin with, this was silly at the Santiago Bernabéu, then it got worse, the home side not so much shooting themselves in the foot as blowing their entire leg off. Then the comeback came, but it remained only half-completed, avoiding defeat but not securing victory. Madrid, who have never been knocked out in the group stages, have a solitary point after two matches.

It could and perhaps should have been nought. Not only were they behind until late on, they were almost caught right at the death, even though Brugge were by then down to 10 and without their captain.

Brugge had been ahead from the ninth minute, although it took a further three for them to know that. Percy Tau was played in up the left and, with Madrid wide open, he put the ball across for Bonaventure who was racing through the middle. What happened next was, frankly, daft. Alone in front of goal, by the six-yard box, Bonaventure failed to control the ball properly, stumbling and watching it bounce off one leg and then the other, the chance apparently wasted. Only, it wasn’t: the ball dribbled past Thibaut Courtois, already on the floor. So slowly did it go that Madrid’s keeper might even have got up in time to prevent it crossing the line.

Facebook Twitter Pinterest Emmanuel Bonaventure is flagged offside after finding the Real Madrid net, but the goal was awarded after a VAR review. Photograph: Pierre-Philippe Marcou/AFP/Getty Images

Courtois, though, couldn’t stop it. The linesman and his referee on the other hand could. Offside was given – and accepted by just about everyone here. Tau had appeared to go unnecessarily early, and so had Bonaventure. On the touchline, Clement literally did a facepalm inspired by how foolishly they had passed up a perfect opportunity. But these are days of video, of routine checks for every goal. And the word came back: onside. Ramos had been the culprit.

Brugge led. Madrid were stunned, groggy, and almost caught again. Bonaventure was away, the linesman’s flag stopping his run. This decision may have been wrong too, but Bonaventure had already put on the brakes. Madrid struggled to escape their own stupefaction. Lucas Vázquez was having an especially horrible time. So was Nacho, beaten often by Krépin Diatta. Madrid had the ball, but every time Brugge came out, they looked vulnerable. In fact, had the Belgians taken better decisions, they might have done more damage.

The Fiver: sign up and get our daily football email.

They did enough. Luka Modric went down in the area, Toni Kroos’s volley deflected just wide, and Eden Hazard and Karim Benzema got in each other’s way. Benzema’s header was blocked and then Simon Mignolet made a sensational save from Raphaël Varane’s header. But at the other end, the threat always lingered. Courtois had to save from Pau, slipped clean through behind Nacho by Diatta’s measured pass.

Manchester City v Dinamo Zagreb: Champions League – live! Read more

Kroos then put a shot fractionally wide. That was the best chance, but it was quickly followed by the second goal for Brugge, and in this too Madrid were complicit in their own demise. Modric lost the ball and Bonaventure rushed through, no one in his way as he headed towards goal. As he approached the area, Bonaventure stumbled, on the verge of falling, but he stayed upright just long enough to dink the ball over Courtois, who was already on his way down.

Madrid were in pieces; the end of the first half was met with furious whistles. Zinedine Zidane acted fast: off went Nacho, replaced by Marcelo. Off too went Courtois, a substitution that some suspected was a statement, cheered by supporters, but that was in fact explained by the goalkeeper’s physical state. During the break, Courtois had been dizzy and vomiting. Alphonse Areola was almost immediately called upon to prevent Bonaventure, clean through and running from deep, from making it three.

Facebook Twitter Pinterest Sergio Ramos rose high to score Real Madrid’s first goal, which was awarded after another VAR review. Photograph: Sonia Canada/Getty Images

Relieved, Madrid reacted. Mignolet had made a couple of saves already when, on 55 minutes, Ramos headed in Benzema’s cross. The flag was up and Madrid’s captain looked offside, but the VAR again decided otherwise. Game on, noise up. Brugge had half an hour to hang on. Ruud Vormer flew in to block a shot from Casemiro, Vázquez bent just wide, and Hazard hit past the post from the edge of the box. Vinícius Júnior was introduced. Bonaventure was withdrawn; Brugge’s fans applauded and Madrid’s probably felt like doing the same, relieved to see him go.

Eden Hazard can shine at Real Madrid without being the new Cristiano Ronaldo | Barney Ronay Read more

The impetus went too, that fury momentarily fizzing out. Vinícius ran but few real chances followed. There were 27 shots from the home side, but not the danger that number suggests. Then a challenge from Vormer, diving in, caught Vinícius on the ankle. Georgi Kabakov sent Vormer off and from the free-kick Casemiro headed Madrid level. They had six minutes to get another.

When Ramos jumped with Mignolet and the ball ran free in the six-yard box, there was a sharp intake of breath, and it felt inevitable that Madrid would score. But they didn’t and in fact, it was Brugge who came closest in those dying minutes. Tau dashed through the middle yet again but did not see the option to pass opening up and was eventually bundled over. From the free-kick, deep into stoppage time, Siebe Schrijvers was suddenly alone deep inside the Madrid area. He had barely been on the pitch a few seconds and he sliced his shot wide.