Poland left it late before goals from substitutes Przemyslaw Frankowski and Arkadiusz Milik, both set up by Robert Lewandowski, gave them a 2-0 win over North Macedonia which guaranteed their place at Euro 2020 on Sunday.
The Poles, who hit the woodwork twice before scoring, made sure of their place from Group G with two matches to spare as they became the fourth team to qualify after Italy, Russia and Belgium.
Poland struggled to make the breakthrough despite enjoying 65% of possession and their frustration grew as Piotr Zielinski struck the bar in the 17th minute and Sebastian Szymanski hit the post five minutes after halftime.
The breakthrough finally came in the 74th minute from substitute Frankowski. A long pass forward found Lewandowski who chested the ball down, nutmegged a defender and was about to shoot when Frankowski sneaked in and poked the ball through Stole Dimitrievski's legs.
Lewandowski was also involved in the second goal six minutes later when he appeared to be fouled but play was waved on and Milik applied the finishing touch, his first Poland goal since last November.
Group G leaders Poland have 19 points from eight matches, three clear of Austria with North Macedonia and Slovenia a further five points behind.
Having never qualified for the Euro finals until 2008, it will be their fourth appearance in a row.