Rarely has a loss felt this good.
Despite a 2-0 defeat to Bosnia-Herzegovina, Wales reached its first international tournament since the 1958 World Cup on Saturday thanks to Cyprus beating Israel 2-1.
Seconds after the match in Bosnia ended, Wales learned that the result in Jerusalem had booked it a place at next year's European Championship in France
''It's probably the best loss of my life,'' Wales and Real Madrid star Gareth Bale said. ''Growing up as a young boy everyone dreams of playing in a major tournament. To achieve it is a dream but it doesn't stop there. We have got to go over there and do some business in France.''
Also qualifying Saturday were 1968 champion Italy and World Cup quarterfinalist Belgium.
The top two finishers from the nine groups qualify automatically. The best third-place finisher also qualifies automatically, while the eight other third-place teams can reach the tournament through a playoff.
Here's a look at the Euro 2016 qualifiers on Saturday:
The Netherlands kept alive its hopes of qualifying by beating Kazakhstan 2-1.
But Turkey went back into pole position to take third place in the group and at least a playoff berth by beating the already-qualified Czech Republic 2-0.
Midfielders Georginio Wijnaldum and Wesley Sneijder scored in either half for the Netherlands to ensure the fight for third goes down to the final round of qualifiers on Tuesday. Islambek Kuat scored a consolation goal with the last touch of the match.
Already-qualified Iceland squandered a two-goal lead to draw 2-2 with Latvia.
The Netherlands went third ahead of the late match in Prague and Iceland's draw put it top, one point ahead of the Czechs. But they didn't stay there long.
Turkey pushed the Dutch back to fourth thanks to a 62nd-minute Selcuk Inan penalty and a Hakan Calhanoglu strike with 10 minutes left to play against the Czech Republic.
Iceland leads with 20 points, one ahead of the Czechs. Turkey is third with 15 points, followed by the Dutch with 13.
Turkey plays Iceland on Tuesday while the Netherlands hosts the Czech Republic in Amsterdam.
Belgium qualified by beating Andorra 4-1, the country's first Euros since co-hosting the tournament in 2000. The wait had been even longer for Wales, and both teams were celebrating on the pitch in Bosnia when news came through that Israel had lost.
Bosnia kept its hopes alive of reaching a playoff with the win. Milan Djuric sent a looping header over Wales goalkeeper Wayne Hennessey in the 71st and the host doubled its lead in the last minute through Vedad Ibisevic.
For Belgium, Radja Nainggolan, Kevin De Bruyne, Eden Hazard and Laurent Depoitre scored.
Cyprus took all three points thanks to an 80th minute goal from Jason Demetriou. Cyprus had taken the lead with a header from Junior Dossa in the 58th, before Nir Bitton equalized in the 76th.
Belgium leads with 20 points, two ahead of Belgium. Bosnia is third with 14 points, one ahead of Israel and two in front of Cyprus.
Wales is now second with 18 points, two behind Belgium. Wales hosts Andorra in Cardiff on Tuesday, while Belgium is at home to Israel.
Stephan El Shaarawy ended a three-year drought by scoring the winning goal as Italy beat Azerbaijan 3-1.
After Eder's opener and an equalizer from Dmitri Nazarov, El Shaarawy finished off a counterattack in the 43rd for his first national team goal since November 2012.
Manchester United's Matteo Darmian added another for Italy in the second half.
''Now that we've qualified it might have seemed easy but nothing is easy,'' said Italy coach Antonio Conte, who took over when Cesare Prandelli resigned after the Azzurri's first-round elimination from last year's World Cup.
Norway took a big step toward qualifying with a 2-0 win over Malta. Alexander Tettey and Alexander Soderlund scored either side of halftime in Oslo.
Croatia beat Bulgaria 3-0 with goals from Ivan Perisic, Ivan Rakitic and Nikola Kalinic. The match was played in an empty stadium in Zagreb as part of the punishment for a swastika that was painted on the pitch before a match against Italy in June.
Italy has 21 points, Norway is next with 19 and Croatia is third with 17.
Andrew Dampf can be followed at www.twitter.com/asdampf