Juventus midfielder Aaron Ramsey scored both goals for the 2016 European Championships semi-finalists who squeezed in ahead of Slovakia and Hungary in Group E.
Wales trailed Hungary by one point leading in to the game, meaning they had to win while Slovakia, who were a point behind the Dragons, hosted group whipping boys Azerbaijan.
Ramsey settled the nerves with the opening goal from a Gareth Bale cross in the 15th minute.
The ex-Arsenal man reacted calmly to slot home the second goal in the 47th minute.
Hungary will now need to qualify via the play-offs, along with Slovakia, who’ll be in Path B.
In Group C, Germany came from a goal down early to thrash Northern Ireland 6-1 to seal top spot.
Serge Gnabry netted a hat-trick for Die Mannschaft after Michael Smith] gave the visitors a seventh-minute lead in Frankfurt.
The Netherlands rounded out qualifying with a comfortable 5-0 win over Estonia.
Georginio Wijnaldum also scored a treble for the Dutch in the victory.
In Group G, Poland edge a five-goal thriller against Slovenia triumphing 3-2 to top the group.
Austria, who had already qualified, suffered a shock 1-0 loss away to lowly Latvia, who had previously lost all nine of their matches.
North Macedonia knocked off Israel 1-0 to finish third in the group.
In Group I, Belgium completed a perfect qualifying campaign with a 6-1 triumph over Cyprus.
The World Cup semi-finalists had to come back after conceding early, with Kevin De Bruyne scoring a first-half double. Christian Benteke also scored a brace.
Playoffs-bound Scotland defeated Kazakhstan 3-1, while Russia eased past San Marino 5-0.
