Wales kept their hopes of automatic qualification for Euro 2020 alive with an assured 2-0 victory in Azerbaijan on Saturday.
Wales travelled to Baku knowing defeat would end their chances of progressing out of Group E, but first-half goals from Kieffer Moore and Harry Wilson eased the nerves as Ryan Giggs' side secured a crucial three points.
Gareth Bale and Aaron Ramsey both got valuable minutes under their belts ahead of Tuesday's final European Qualifier at home to Hungary - live on Sky Sports - where nothing less than a victory will do.
Live Euro 2020 Qualifiers
And Croatia's victory over Slovakia on Saturday night means Wales' fate is back in their hands and qualification can be secured with victory on what's sure to be an electric night in Cardiff.
Azerbaijan: Balayev (7), Pashaev (6), Mustafazade (5), Badavi Huseynov (6), Krivotsyuk (6), Abdullayev (5), Nazarov (6), Garayev (6), Richard (6), Rahimov (5), Sheydayev (7).
Subs: Xalilzada (6), Ramazanov (6), Huseynov (n/a).
Wales: Hennessey (7), Connor Roberts (8), Lockyer (7), Mepham (7), Ben Davies (7), Wilson (8), Ampadu (7), Morrell (7), James (8), Bale (7), Moore (8).
Subs: Ramsey (7), Matondo (n/a), Vaulks (n/a).
Man of the match: Kieffer Moore.
How Wales kept their Euro 2020 dream alive
Wales started in positive fashion with Azerbaijan goalkeeper Emil Balayev pushing out early efforts from Wilson and Joe Morrell.
Moore then headed Wales into a 10th-minute lead, meeting Wilson's corner at the far post and bundling the ball home from close range.
Wales doubled their lead after 34 minutes when Daniel James cut inside onto his right foot for an effort which hit both the crossbar and the post.
Wilson was in the right place at the right time to head the rebound into an unguarded goal, the forward's first goal for Wales in just over a year.
Azerbaijan looked to respond before the break, and they wanted a penalty when Dmitrij Nazarov's drive struck Tom Lockyer on the arm inside the penalty area. But German referee Deniz Aytekin waved away the appeals before booking Nazarov for dissent as Wales reached half-time two goals to the good and in firm control of the contest.
Wilson and Moore went close to extending Wales' lead at the start of the second half and Tom Lockyer saw his header from close range correctly disallowed for an Ethan Ampadu push on Agayev.
Gareth Bale captained Wales in their crucial Euro 2020 qualifier in Azerbaijan despite not having played for over a month because of a calf problem.
Aaron Ramsey, yet to play in Euro 2020 qualifying, was on the bench after injury as Chris Mepham, Joe Morrell and Harry Wilson featured after last month's 1-1 draw against Croatia.
Injured pair Joe Rodon and Jonny Williams and the suspended Joe Allen dropped out, while Azerbaijan made four changes from the side beaten in Hungary last month.
Bale was then replaced just before the hour mark with Tuesday's final qualifier against Hungary in Cardiff in mind.
Ramsey came on his place to make his first Wales appearance in an almost exactly a year and he picked up important game-time as Wales saw out the game to head into the Hungary showdown full of confidence.
What the managers said…
Wales boss Ryan Giggs: "The performance, as always, could be better but the result was the main thing. I'm pleased with a lot of things we did, we played some really nice football at times. Some of the quality of the play was outstanding, we've improved since the Azerbaijan game (2-1 home win in September).
"We've started to gain some momentum, which is not easy in international football. Azerbaijan is not an easy place to come and there was so much on the game that it's up there with one of my best performances.
"Depending on results, it sets things up nicely for Tuesday. It's hard to get too excited for Tuesday because of the Croatia vs Slovakia game, but we have done all we can. Cardiff isn't an easy place to come."
Azerbaijan manager Nikola Jurcevic said: "Wales deserved to win this game because they were the better team. We conceded goals from set-pieces, not for the first time against very big players. We had lots of set-pieces ourselves but the big difference between us and Wales was that they were really dangerous from theirs."
The pundit view...
Former Wales midfielder Dave Edwards: "The victory has set Wales up for a great game in Cardiff on Tuesday and you can almost sense a bit of optimism now half the job is done. This was supposed to be the stumbling block if you like and I'm sure they can now go on and put in a big performance on Tuesday.
"Wales will be brimming with confidence. Bale came through the game, Ramsey came through the game, James is on fire and Moore got four or five good chances. It's all looking good."
Former Wales defender James Collins: "It was a tremendous professional performance from such a young side. they controlled the game and were very comfortable. They were probably unlucky to come away with just two goals. There were a lot of chances in the game and a lot of chances created which will be a real positive for Ryan Giggs going into a massive game on Tuesday."
Man of the match - Kieffer Moore
Moore's stellar start to his international career continued in Baku.
He has scored two goals in four appearances for Wales this season, one more goal than he has scored in 14 matches in 2019-20 for club side Wigan Athletic.
He had 10 shots against Azerbaijan, five of which were on target; the last Wales player to have as many in a single match was Aaron Ramsey vs Moldova in September 2017 (also 10).
Edwards on Moore's performance: "He was dangerous all night. Any sort of ball that came into the box he always got there first and always made contact. He's a real threat for Wales going forward."
Wales finally win away
- Wales have won a European Championship qualifying match away from home for the first time this campaign, having not done so since September 2015 vs Cyprus under Chris Coleman.
- Wales are now unbeaten in eight meetings against Azerbaijan, winning seven games and drawing once; they have faced no other side as many times without ever losing.
- Harry Wilson has both scored and assisted in the same game for Wales for the first time since March 2018 against China in the China Cup.
Wales host Hungary in their final European Qualifier on Tuesday at 7.45pm - live on Sky Sports Main Event.