Poland's Wojciech Szczesny saved a Daniel James spot kick as they dashed Wales' hopes and won a penalty shootout 5-4 to qualify for Euro 2024 as the last country through from the playoff finals on Tuesday.
The victory at the Cardiff City Stadium, after a cagey 90 minutes and further deadlock in extra time, secured Poland a fifth straight appearance at the continental tournament.
They will be in Group D with France, the Netherlands and Austria at the finals in Germany, which start in June.
"It wasn't easy because we knew Wales at home are dangerous. For us the most important thing was to play our own game and that's what we've done," said Poland manager Michal Probierz.
"We missed opportunities to shoot more, we are aware of that. The most important thing was qualifying and nobody cares about anything else today."
Wales went into their first ever shootout with 10 men after Chris Mepham was sent off in added time of extra time for a second yellow card but they matched Poland until James' miss.
It was the first time since 2012 that Wales, whose talismanic record scorer Gareth Bale retired after the 2022 World Cup in Qatar, had failed to qualify for the Euros.
Defender Ben Davies, captain in the continued absence of midfielder Aaron Ramsey, had the home fans roaring when he headed into the net on the stroke of halftime but it was confirmed as offside by VAR after the linesman had flagged.
Striker Kieffer Moore also had a looping header well saved by Szczesny in the second half, while Poland's Jakub Piotrowski shot just over the bar in extra time.
"It is a cruel game, that's what I've said to the players," said Wales manager Rob Page, whose side thrashed Finland 4-1 in the playoff semi-final last week and had home advantage again.
"One kick away from qualifying and it hurts.
"I thought we were the better team. My message to the players at halftime was: 'We are the better team, we will go on to win this game'."
Poland, with captain and talismanic forward Robert Lewandowski stepping up to score the first penalty after a confident shimmy to send Danny Ward the wrong way, failed to produce a shot on target until then while Wales had four.
Davies calmly levelled the score at 1-1 in the shootout, Sebastian Szymanski kept Poland ahead and Moore made it 2-2 with a shot that bounced in off the bar.
Poland's Przemyslaw Frankowski fired into the top corner and Wales' Harry Wilson shot bravely down the middle, with Nicola Zalewski taking the score to 4-3 for the visitors before Neco Williams again equalised for the Welsh.
Pole Krzysztof Piatek then scored a fifth, leaving Leeds United forward James the task of extending the shootout to sudden death, but Szczesny dived the right way leaving his team to sing joyously with the delirious travelling fans.