Wales will have to navigate the play-offs in March to reach Euro 2024 after missing out on automatic qualification following a fiery draw at home to Turkey.
Wales needed to beat Group D winners Turkey and hope Croatia dropped points at home to Armenia and, for much of Tuesday night, it seemed like Robert Page's side would fulfil their part of that equation as Neco Williams fired them in front in the seventh minute.
But Croatia's victory over Armenia meant even a Welsh win would not have been enough and, to make matters worse, Turkey equalised midway through the second half thanks to a controversial penalty scored by Yusuf Yazici.
Referee Matej Jug's decision to award the spot-kick was harsh on Wales captain Ben Davies, who barely touched Kenan Yildiz, and the hosts' sense of injustice was particularly intense because of the referee's rejection of three Welsh appeals for penalties in the first half.
That anger was replaced by a deflating feeling of anti-climax at the final whistle but, as disappointing as this evening was for Wales, the greatest regret of this campaign for Page and his players will be the two matches against Armenia.
Most damaging was June's capitulation in Cardiff, a 4-2 defeat which left Wales' hopes of qualifying automatically in ruins. Although they revived those hopes by brilliantly beating Croatia in October to leave their destiny in their own hands, Wales threw away that opportunity by drawing 1-1 in Yerevan last Saturday.
That left them needing a favour from Armenia on Tuesday but, with Croatia in no mood to be charitable in Zagreb, any notion of a dramatic turnaround in Wales' favour disappeared.
As much as those results against Armenia may eat away at Wales, they can at least console themselves with the knowledge that they have a second shot at qualification.
On 21 March, Wales will host either Ukraine, Finland or Iceland in a one-legged play-off semi-final. If they are successful, they will face Poland or Estonia - with home advantage to be decided via a draw this Thursday - in another one-off tie five days later, with the winner securing their place at next summer's tournament in Germany.
Hopes dashed of another famous Cardiff night
Welsh football has enjoyed some special nights at Cardiff City Stadium in recent years, with a fervent crowd helping its team over the line in several decisive matches.
And while this group of players could draw inspiration from previous triumphs - Belgium in 2015, Hungary in 2019, Austria and Ukraine in 2022 and Croatia just last month - the difference this time was that Wales were not in sole control of their own fate.
Whereas those landmark victories were all that Wales needed at those precise moments in time, a win on this occasion would only be half the battle.
Page's men needed to overcome already-qualified Turkey - in itself no mean feat - while also requiring Croatia, World Cup semi-finalists less than a year ago and runners-up in 2018, to drop points at home to Armenia, 85 places below them in the world rankings.
Put simply, for Wales this was a long shot. In fact, you could have argued they needed a miracle.
They made the perfect start to their onerous task, with Harry Wilson spreading the play out to the left wing, where Williams cut inside on to his right foot and stroked a calm finish into the bottom far corner.
The celebrations among Wales' players, staff on the touchline and fans in the stands were proof that they believed they could pull this off, however improbable the odds.
Wales kept attacking too, streaming forward and silencing the boisterous travelling Turkish fans.
The hosts had three penalty appeals rejected, one as Wilson fell under a challenge from Abdulkerim Bardakci and two in quick succession as Brennan Johnson was brought down by Samet Akaydin.
The last of those was Wales' strongest shout, with Akaydin barging into Johnson's back at a corner, but Slovenian referee Jug somewhat bafflingly chose not to point to the spot.
Having weathered that pressure, Turkey had a decent spell of their own as Kerem Akturkoglu shot over from close range - but Wales were still the better side.
As well as things were going in Cardiff, however, Wales still needed a favour in Zagreb. Armenia kept their side of the bargain until the 43rd minute when they fell behind to a goal by Croatia's Ante Budimir.
If Wales had allowed themselves to dream, Budimir's goal was a brutal reality check.
Turkey then twisted the knife when they were given the softest of penalties, as Wales captain Davies brushed against Yildiz, who threw himself to the ground.
Yazici calmly sent Danny Ward the wrong way with his low penalty and, buoyed by their equaliser, Turkey were close to taking the lead when Yusuf Sari's long-range shot brushed the bar.
Roared on by their furious supporters, Wales rallied and put Turkey under pressure late on, gamely pushing for a winner even though Croatia's 1-0 win over Armenia ultimately meant their efforts were in vain.
This was a frustrating end to the campaign for Wales but they will be back at Cardiff City Stadium in March, knowing that they will be two wins away from qualifying for Euro 2024.