For their group finale Ireland produced their best performance of the campaign but, agonisingly for them, it was not quite good enough. They brewed up a mighty storm but precision eluded them and so, in the 73rd minute, did concentration. That allowed Martin Braithwaite to step in to send Denmark to Euro 2020 with their first shot on target.

Ireland nearly forced a late twist after Matt Doherty headed an equaliser five minutes from time but, for all their valiance, scoring twice proved to be beyond the hosts.

Still, they were clapped off by a home crowd who appreciated how close they had come to a sensation.

There were reasons to justify hopes that Ireland could reach the finals through play-offs in March. They could meet Wales or Northern Ireland, among others, depending on the result of Wales’s match against Hungary on Tuesday.

“I’m immensely proud of the performance,” said Mick McCarthy. “I’m disappointed with the result but that’s the only thing I’m disappointed with.”

There was more than a hint of relief in Denmark’s celebrations; beforehand they had spoken as if they were very obviously superior to a side they know very well – but that conviction did not withstand this, the countries’ fifth draw in six meetings over the past two years. Ireland had most of the play and nearly all of the chances.

“We didn’t play well and we were lucky to get away with a draw,” said the Denmark manager, Age Hareide.

“[Ireland] put on a lot of pressure but we didn’t play well at all. I don’t know what happened to us. I think we had nerves on the outside of our shirts. But solid defensive play saw us through the first half and the start of the second half and then we scored. And then when they scored, they put a lot of pressure on.

“If [Ireland] keep playing like that, they will probably come through the play-offs.”

It was, then, an evening where Ireland failed to achieve their mission but emerged with their credibility enhanced. In the build-up the talk of replicating glorious feats of the past had carried a whiff of the ghost dance, little about the campaign having suggested a heroic performance was really imminent. Yet it nearly materialised.

They made a proactive start, showing a willingness to pass their way forward and to win the ball back quickly when they lost it. Ireland did not make any impression on the Danish defence but there was certainly no sign of the visitors’ supposed supremacy. They, mind you, needed only to draw.

Denmark suffered blows when they lost two players to injury in the first half, the midfielder Thomas Delaney and Andreas Cornelius. The latter, a striker, left on the half-hour before anyone had mustered a shot.

Conor Hourihane fired off the first effort in the 34th minute after darting on to a pass by David McGoldrick but his side-footer was too close to Kasper Schmeichel.

Alan Browne worried Schmeichel with a snapshot from distance three minutes later but it bounced just wide. McGoldrick then let fly from even further out. His shot whizzed high and wide but by half-time Danish minds could not have been doubt-free.

Ireland grew more threatening in the second period. Ciaran Clarke, a half-time replacement for the injured John Egan, had a header from a corner deflected wide in the 48th minute. The next corner spread panic in the box, Schmeichel fortunate to scramble the ball away.

Could Ireland summon the precision to translate their blustery menace into an all-important goal?

Doherty and Enda Stevens added to Denmark’s worries by joining in attacks. A burst by Stevens in the 66th minute led to McGoldrick slashing a shot over the bar from 10 yards.

Then, the decisive lapse. From a throw-in on the right Denmark were allowed to work Henrik Dalsgaard into space to pick out a cross from deep. Braithwaite ran away from Doherty on the blind side of Shane Duffy and poked into the net from close range.

Game over? Not quite. Ireland rallied and Doherty atoned by getting on the end of a cross by Stevens to slam a header into the net. Denmark, however, clung on.