Tomas Bobcek's stoppage-time goal ended Northern Ireland's hopes of making it out of World Cup qualifying Group A, but they came away from a 1-0 loss in Slovakia assured of a play-off place regardless.
Debutant Bobcek had only been on the pitch for three minutes in when he fired in from Laszlo Benes' corner in the first of eight minutes added on, and the goal stood despite Northern Ireland appeals for a foul after Daniel Ballard had gone down in the build-up.
Slovakia had already seen second-half strikes from Lukas Haraslin and David Strelec chalked off, but this time the goal stood to spark wild celebrations as the home bench emptied.
- Who has qualified for the World Cup? | World Cup news
- World Cup schedule, dates and venues
- World Cup qualifying fixtures and results
Northern Ireland, missing four of the players who started last month against Germany, battled hard for 90 minutes but Slovakia held the edge and will go to Leipzig on Monday with a chance to top the group if they can beat Germany.
Northern Ireland's misery was completed by a second yellow card for Ballard in the dying moments, but Croatia's 3-1 win over the Faroe Islands means they will be in the play-offs in March having won their Nations League group.
With Shea Charles, Ali McCann, Brodie Spencer and Ethan Galbraith missing through injury and suspension, Michael O'Neill brought in Brad Lyons, Ruairi McConville, George Saville and the returning Conor Bradley, while Dion Charles started up front.
Slovakia, boosted by the returns of Stanislav Lobotka and David Hancko, immediately tried to get at this weakened Northern Ireland side in a reverse of their 2-0 defeat in Belfast last month, but after a shaky start the visitors grew into the game.
Northern Ireland should have led 17 minutes in when Ballard beat three defenders to get his head to Justin Devenny's free-kick, only to see his chance go a whisker wide.
Slovakia immediately responded with their best chance of the half as Middlesbrough's Strelec appeared to beat the offside trap to go one-on-one with Bailey Peacock-Farrell only to hit the post. The ball spun out to David Duris but he had no time to adjust as his header went over.
It was a tense, scrappy match, indicative of what was riding on it for both teams, and Northern Ireland were relying on set-pieces, but only half-chances fell to Charles, who was then replaced by Jamie Reid at the break.
Slovakia thought they had taken the lead eight minutes into the second half when Haraslin's drilled low free-kick from a tight angle went all the way through, but Milan Skriniar was offside as he stretched for the ball in front of Peacock-Farrell.
That raised the volume levels inside the Kosicka Futbalova Arena and they were even louder 10 minutes later when the hosts had another one ruled out. Again it was a free-kick wide on the left, fired in by Haraslin, but Strelec used a hand to turn it beyond Peacock-Farrell.
O'Neill tried changes of personnel and shape but Slovakia kept on coming and the resistance broke at the death as Peacock-Farrell was unable to deal with the corner and Bobcek had his moment of glory.
Ballard was then shown a harsh yellow for a push on Lobotka to earn his marching orders and, as the night unravelled for Northern Ireland, O'Neill was also booked by referee Istvan Kovacs after the final whistle.
O'Neill: 'Referee had to be stronger'
Northern Ireland boss Michael O'Neill:
"You're always disappointed when you lose a game late as we did, especially to a goal that should clearly have been disallowed.
"There's a clear push on Daniel Ballard at the corner, two hands on his back.
"The other two goals that were disallowed should have been disallowed. The first goal was offside, the lines clearly show that, the second goal was handball.
"You have to look at each incident on its merit, you can't look at it cumulatively and referee the last incident differently from how you've refereed the other two. That's what (VAR) is there for…
"Bailey will know he should have done better. He comes when maybe he doesn't need to come… but ultimately it's still a foul.
"I said to the referee that he needed to be stronger and he booked me. But I went to shake his hand. I said, 'you need to be stronger' and that was enough for him to book me. If I'm not allowed to say that, then I shouldn't have said that."
Northern Ireland latest
- Northern Ireland latest news
- Northern Ireland fixtures
(c) Sky Sports 2025: Slovakia 1-0 Northern Ireland: Late goal ends automatic World Cup qualification hopes but play-off place secured
Grand Slam of Darts: Luke Humphries and Gerwyn Price set up semi-final showdown as Michael Smith's run comes to an end
Joseph Parker fails drugs test: Heavyweight tested positive for traces of cocaine on day of Fabio Wardley defeat
Antoine Semenyo: Liverpool, Man City and Spurs monitoring Bournemouth forward ahead of January transfer window