Slovakia scored their first goals since June as they booked their place at next summer's European Championship with a 4-2 victory over Luxembourg.
Jan Kozak's side, who had not found the net since their 2-1 win against Macedonia four months ago, clinched automatic qualification thanks to Marek Hamsik's brace and further goals from Adam Nemec and Robert Mak.
It was not all plain sailing for the visitors, however, with Luxembourg scoring twice in four second-half minutes to give their opponents a scare.
Slovakia began the day level on points with Ukraine, but Mykhaylo Fomenko's outfit fell to a 1-0 defeat against Euro 2012 champions Spain and will finish Group C in third.
The visitors started the game brightly and almost took the lead in the 19th minute when the ball fell to the feet of Martin Skrtel seven yards from goal but the Liverpool defender drilled his effort narrowly wide of the left-hand post.
But Slovakia did not have to wait long for their opener, with Hamsik putting them in front after 24 minutes when he burst into the box before unleashing a left-footed strike that flew past Luxembourg goalkeeper Jonathan Joubert.
The visitors doubled their lead just before the half-hour mark when Adam Nemec turned the ball home from five yards out after good work from Vladimir Weiss on the right wing, before Mak added another from close range just one minute later.
Kozak's men looked to be cruising towards victory until a wonderful 30-yard strike from Mario Mutsch gave Luxembourg a foothold in the game after 62 minutes.
The hosts reduced the deficit four minutes later when Lars Gerson scored from the penalty spot after Nemec had fouled Aurelien Joachim in the box.
But Slovakia restored their two-goal advantage in the first minute of added time when Hamsik fired in from just inside the penalty area.