Match ends, Wales 2, Hungary 0.
Wales secured qualification for Euro 2020 as Aaron Ramsey marked his return to the team with two goals to inspire a joyous 2-0 win over Hungary.
Ramsey, starting for the first time in this campaign, headed in from Gareth Bale's first-half cross to fuel a carnival atmosphere at a heaving Cardiff City Stadium.
A superb double save from Wayne Hennessey kept Hungary at bay and then, 90 seconds into the second half, Ramsey calmly controlled the ball in the penalty area before stroking it into the top corner.
Bale came close to adding a third with a fierce free-kick which fizzed narrowly over, while Ramsey was denied a hat-trick by Hungary goalkeeper Peter Gulacsi.
But nothing could detract from the euphoria in the stands as Wales rejoiced at the prospect of playing at only a third major tournament in their history.
Next summer's European Championship will be Wales' second in succession, a remarkable transformation for a country which had to endure 58 barren years between its first appearance at a major tournament, the 1958 World Cup, and its second at Euro 2016.
- 'Wales. Golf. Madrid. In that order' - Bale risks further rift with Real
- Wales 'want to have time of lives' at Euros
- Has Giggs won over fans with Euro 2020 qualification?
Ramsey's glorious return
Qualification also represented an extraordinary turnaround in this campaign alone.
When Wales lost in Hungary in June, they were left with only three points from their first three matches and with their hopes of qualifying hanging by a thread.
But having avoided defeat since then, Ryan Giggs' side were gathering momentum at just the right moment.
Nobody epitomised that sense of timing better than Ramsey, who had returned from a series of injuries to make his first appearance of the campaign as a substitute during Saturday's 2-0 win in Azerbaijan.
The Juventus midfielder came on for Bale on that occasion but both started against Hungary, Wales able to name the integral duo in the same team for the first time since November 2018.
Ramsey and Bale's influence on the national team is enormous, illustrated by the fact they had not lost a qualifier while playing together since a 2-0 defeat in Bosnia-Herzegovina in October 2015, which was academic as Wales qualified for Euro 2016 that night anyway.
They demonstrated their value to Wales once more on this occasion with a wonderfully worked first goal, Bale curling in a perfectly-weighted left-footed cross from the right and Ramsey heading in to get the party started in Cardiff.
Bale almost created a second goal when he crossed beautifully again, this time with his right foot, for Kieffer Moore, but the striker's header was wide.
Moore atoned for that miss by playing his part in Wales' second goal, hooking a free-kick towards Ramsey, who was composure personified as he controlled the ball and finished with a flourish.
Wales had several chances to extend their lead, with Bale, Daniel James and Ramsey all going close.
But it did not matter. Despite a fleeting sign of Hungary's threat in the first half, the visitors posed no danger in the second.
Wales' players enjoyed themselves as they closed out the game, and then when the final whistle blew the celebrations could start in earnest.
Wales banish history's burden
Before qualifying for Euro 2016, Wales had come to be defined by their failures, a footballing nation weighed down by its past littered with near misses.
Final hurdles had proved Wales' undoing too many times: Scotland in 1977, Romania in 1993, Russia in 2003 and the Republic of Ireland in 2017 all etched on the national consciousness.
But although this side to face Hungary contained five of the line-up which lost to the Republic in the Welsh capital two years ago, this was also a Welsh squad comprised largely of young players unaffected by history's scars.
For the new generation, it is expected that Wales qualify - or that they are at least in contention until the very end.
This was a third qualifying campaign in succession where Wales entered their final fixture with their hopes of reaching the finals of a major tournament still alive.
They rose to the occasion here with a performance of supreme confidence and maturity, the old guard of Ramsey and Bale combining with the emerging talents of James, Connor Roberts, Ethan Ampadu and others.
Bale said on the eve of this match that Wales were using the "euphoria" of Euro 2016 as well as the pain of missing out on last year's 2018 World Cup as inspiration against Hungary.
Wales have learnt how to positively harness their history - rather than be burdened by it - and now they can look forward to writing a new chapter at Euro 2020.
Man of the match - Aaron Ramsey
- 16LockyerBooked at 72mins
- 18MorrellSubstituted forAmpaduat 50'minutes
- 11BaleSubstituted forH Wilsonat 88'minutes
- 20JamesBooked at 88mins
- 8H Wilson
- 16PátkaiBooked at 66mins
- 8NagySubstituted forKovácsat 60'minutesBooked at 71mins
- 7DzsudzsákSubstituted forVargaat 72'minutes
- 20SallaiSubstituted forHolenderat 83'minutes
- Ovidiu Hategan
- Shots on Target
Second Half ends, Wales 2, Hungary 0.
Offside, Hungary. István Kovács tries a through ball, but Filip Holender is caught offside.
Attempt saved. Harry Wilson (Wales) left footed shot from outside the box is saved in the centre of the goal. Assisted by Kieffer Moore.
Foul by Máté Pátkai (Hungary).
Kieffer Moore (Wales) wins a free kick on the right wing.
Corner, Wales. Conceded by Botond Baráth.
Offside, Hungary. Zsolt Nagy tries a through ball, but Filip Holender is caught offside.
Substitution, Wales. Harry Wilson replaces Gareth Bale.
Daniel James (Wales) is shown the yellow card for a bad foul.
Dominik Szoboszlai (Hungary) wins a free kick on the right wing.
Foul by Daniel James (Wales).
Attempt blocked. Máté Pátkai (Hungary) right footed shot from outside the box is blocked. Assisted by Dominik Szoboszlai.
Foul by Filip Holender (Hungary).
Tom Lockyer (Wales) wins a free kick in the defensive half.
Attempt blocked. Gareth Bale (Wales) left footed shot from outside the box is blocked.
Foul by Ádám Szalai (Hungary).
Chris Mepham (Wales) wins a free kick in the defensive half.
Substitution, Hungary. Filip Holender replaces Roland Sallai.
Attempt missed. Chris Mepham (Wales) header from the centre of the box misses to the right. Assisted by Ben Davies with a cross following a set piece situation.