The Welsh, who reached the Euro 2016 semi-finals, finished runners-up on 14 points from eight games, three behind Croatia who sealed their berth on Saturday.
Wales reached their second straight European Championship finals after a goal in each half by midfielder Aaron Ramsey gave them a 2-0 home win over Hungary in their decisive Group E qualifier on Tuesday.
The Welsh, who reached the Euro 2016 semi-finals, finished runners-up on 14 points from eight games, three behind Croatia who sealed their berth on Saturday with a 3-1 win over Slovakia.
Having previously gone 58 years without reaching a major tournament after the 1958 World Cup, there were joyous scenes at the Cardiff City Stadium as Wales produced a dominant display to wrap up qualification.
Both sides needed victory to progress and Wales drew first blood when Ramsey rose to head home from six metres in the 15th minute after a perfect Gareth Bale cross from the right.
With Hungary pressing for an equaliser, goalkeeper Wayne Hennessey made a crucial double save in the 34th minute when he parried a Dominik Szoboszlai shot from eight metres and then smothered Roland Sallai’s follow up.
Ramsey, who tore Hungary's midfield apart with crisp passing, struck again in the 47th with a close-range drive into the top corner after Kieffer Moore scrambled a Ben Davies free-kick into his path.
Hungary were fortunate not to concede more goals as Daniel James curled a shot from the edge of the penalty area inches wide before Hungary keeper Peter Gulacsi denied Ramsey a hat-trick with a reflex save.
The Hungarians will have another chance to reach next year's 24-nation tournament via the playoffs and so will Slovakia, who beat Azerbaijan 2-0 at home in the group's other fixture.
Belgium thrashes Cyprus
Christian Benteke and Kevin De Bruyne scored two goals each as Belgium thrashed Cyprus 6-1 in their Euro 2020 Group I qualifier at the King Baudouin Stadium on Tuesday.
Belgium finish top of their pool with a perfect 10 wins from 10 games, scoring 40 goals in the process, as Yannick Carrasco and an own goal from Kypros Christoforou completed the rout of Cyprus.
The visitors had silenced their hosts with an early strike as Nicholas Ioannou drilled the ball into the corner of the net, but the Belgium supporters were soon back on their feet after an exhibition from their side after that.
Carrasco’s excellent pass provided the opportunity for Benteke to level the score before Cyprus goalkeeper Michael Neofytos somehow allowed De Bruyne’s weak shot to squirm past him.
Carrasco was the provider again as he teed-up De Bruyne to complete a brace before the former grabbed the goal his performance deserved a minute before the break after burying his shot from Eden Hazard's pass.
There was little let-up in the second period as Belgium continued to dominate, with Christoforou putting the ball into his own net and Benteke adding the sixth.
Wijnaldum hat-trick drives the Netherlands to easy win over Estonia
Georginio Wijnaldum struck a hat-trick as the Netherlands, who had already booked a spot at Euro 2020, eased to a 5-0 victory over Estonia in their final Group C qualifying clash at the Johan Cruyff Arena on Tuesday.
The home side were in complete control of the contest from early on, with defender Nathan Ake and 18-year-old debutant Myron Boadu also among the goals, as they finished second in the standings with 19 points from eight games, two behind group winners Germany.
Netherlands coach Ronald Koeman said before the game that he would experiment with team selection and stuck to his word, with livewire Quincy Promes converted to right-back, and AZ Alkmaar forward Calvin Stengs, 20, handed a debut from the start.
It took the home side just six minutes to hit the front, as Promes was afforded far too much space on the right and his delivery was headed back across goal and into the net by Wijnaldum, who netted eight times in his seven matches in the qualifiers.
Netherlands dominated possession and launched wave after wave of attacks. They were rewarded for their endeavour with a second goal as Ake headed in a cross from Memphis Depay.
There was little to enthuse over in the opening 20 minutes of the second period but the Netherlands got their third when Stengs robbed the ball off Estonia defender Karol Mets and set up Wijnaldum for his second.
Captain for the night, Wijnaldum then collected a pass from Stengs to complete his hat-trick, before AZ forward Boadu came off the bench to net the fifth.
Germany crush Northern Ireland with Gnabry treble to top group
Serge Gnabry scored a hat-trick as already-qualified Germany came from a goal down to crush Northern Ireland 6-1 in their final Euro 2020 qualifier to finish top of Group C on Tuesday.
It was a successful end to a difficult year for Germany, seeking to overhaul the team after last year's shock World Cup first-round exit and Nations League relegation.
They qualified, having won seven of their eight qualifiers and losing once to the Netherlands.
With qualification already sealed after Saturday's 4-0 victory over Belarus, Germany showed no nerves and quickly cancelled out Michael Smith's shock eighth-minute opener for the visitors with Gnabry's fine turn and shot in the 19th.
Leon Goretzka's 43rd-minute goal put Germany ahead before Gnabry then drilled in their third straight after the restart.
The 24-year-old winger completed his hat-trick on the hour to take his tally to 13 goals in 13 internationals. Goretzka then fired in from 20 metres to crown his own fine performance.
Julian Brandt completed the rout in stoppage time as the Germans finished on 21 points, two ahead of the second-placed Dutch, while Northern Ireland ended the qualifying campaign in third place on 13 points and will go into the playoffs.