Match ends, Azerbaijan 0, Wales 2.
Wales eased to a comfortable win in Azerbaijan to set up a winner-takes-all match with Hungary for automatic qualification for Euro 2020.
Kieffer Moore headed the dominant visitors into an early lead, which was doubled when Harry Wilson nodded into an empty net after Daniel James' fierce swerving shot rebounded off the crossbar and post.
Wales maintained their control in the second half and, although Moore and Wilson missed the best chances to extend their advantage, it mattered little as Ryan Giggs' side coasted to victory.
Croatia secured top spot in Group E by beating Slovakia 3-1 on Saturday, meaning Wales can take the second qualifying place with a win over Hungary in Cardiff on Tuesday.
A draw in that match could allow Slovakia to clinch second place with a win over Azerbaijan.
Ryan Giggs' side do have the back-up route of a guaranteed play-off place thanks to Sweden's win over Romania in Group F on Friday.
But having suffered so many agonising qualifying near misses in the past, Wales will be eager to take the lottery of a play-off out of the equation by beating Hungary to secure what would be only their third appearance at a major tournament.
Wales fuel Euro 2020 hopes with strong start
Having waited 58 years between their first and second appearances - the 1958 World Cup and the run to the semi-finals of Euro 2016 - Wales are anxious not to endure another long barren spell.
They travelled to Baku walking a qualification tightrope, knowing there was precious little room for error.
Although they were still relying on results elsewhere, Giggs and his players were aware that to have any realistic hope of qualifying automatically they had to win here and then against Hungary in Cardiff on Tuesday.
Wales wanted to control their own destiny as best they could, and they seized control of this match with a purposeful start.
Whereas Giggs' side were hesitant and disjointed against the same opponents in September, here they were confident and dominant in possession.
They built their attacks patiently and made an early breakthrough as Harry Wilson's looping corner to the back post was bundled in from close range by Moore.
The Wigan striker had a fine chance to score a second but his right foot was less effective than his head as his low shot was smothered by Emil Balayev in the Azerbaijan goal.
That was a rare misstep in an excellent display from Moore, who has already established himself as the focal point of Wales' attack despite only making his debut in September.
The miss did not matter as, three minutes later, Wales doubled their advantage when James cut inside from the left wing and unleashed a vicious shot towards the top far corner. The ball cannoned off the crossbar and post before sitting up invitingly for Wilson, who nodded it into the empty net.
The goal put Wales in total control at half-time, giving Giggs the luxury of already turning his attention to Tuesday's match against Hungary.
A job half done
Giggs said in the build-up to the match in Baku that he was planning for the fixture with one eye on the group finale in Cardiff.
Wales needed to win both matches so, although beating Azerbaijan was the initial priority, Giggs had to ensure his squad was poised to follow up this performance with a display of similar quality against tougher opposition in the form of Hungary.
That is why the former Wales and Manchester United captain left Aaron Ramsey on the bench at the Bakcell Arena.
A series of injuries meant the Juventus midfielder had not yet featured in this qualifying campaign, and his return to full fitness was regarded as a major boost for these two matches.
But like Gareth Bale, who had not played since last month's draw with Croatia, Ramsey was lacking match fitness, which meant he would have to be managed carefully over the course of this double-header.
Wales' position of strength in Baku meant they were able to take Bale off after an hour, limiting his exertions and ensuring he avoided a third yellow card of the campaign which would have caused him to miss the Hungary match through suspension.
Ramsey took his place, a useful 30-minute workout for the former Arsenal playmaker, while keeping him fresh for Tuesday's crucial fixture.
Ramsey and Bale have 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.
Against Hungary on Tuesday, Wales will hope to have them back on the pitch together for the first time since November 2018, with fingers crossed they can maintain their proud record in what will be a match of huge significance.
Wales boss Ryan Giggs on Sky Sports: "The performance like always could be better but the result was the main thing tonight. It's set up nicely for Tuesday.
"Kieffer is a threat and we recognised they might be a bit weak at set-pieces. We were pleased to get the big man on the scoresheet again.
"I thought the referee handled the game well and there were no silly fouls from us - going into Tuesday we wanted our best players available.
"We've played some good football at times which is pleasing. It could have been better but overall I was happy with the performance."
Man of the match - Kieffer Moore
Unbeaten run against Azerbaijan continues - the stats
- Wales are unbeaten in eight meetings against Azerbaijan, winning seven games and drawing once; they have faced no other side as many times without losing
- Azerbaijan are winless in 12 European Championship qualifying matches (D4 L8), and have failed to keep in a clean sheet in their past 10 such games.
- Wales have won a European Championship qualifying match away from home for the first time this campaign, having not done so since September 2015 v Cyprus under Chris Coleman.
- 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.
- Kieffer Moore 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.
- Moore 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 v Moldova in September 2017 (also 10).
- 18KrivotsyukSubstituted forXalilzadeat 45'minutes
- 7AbdullayevSubstituted forRamazanovat 64'minutes
- 13NazarovBooked at 40minsSubstituted forHuseynovat 82'minutesBooked at 89mins
- 20Almeida de Oliveira
- 3RahimovBooked at 89mins
- 11SeydaevBooked at 68mins
- 15AmpaduBooked at 14minsSubstituted forVaulksat 87'minutes
- 18MorrellBooked at 81mins
- 11BaleSubstituted forRamseyat 60'minutes
- 7WilsonBooked at 89mins
- 20JamesSubstituted forMatondoat 82'minutesBooked at 90mins
- Deniz Aytekin
- Shots on Target
Second Half ends, Azerbaijan 0, Wales 2.
Rabbi Matondo (Wales) is shown the yellow card.
Foul by Ben Davies (Wales).
Tamkin Xalilzade (Azerbaijan) wins a free kick on the right wing.
Foul by Will Vaulks (Wales).
Javid Huseynov (Azerbaijan) wins a free kick on the left wing.
Aaron Ramsey (Wales) wins a free kick on the left wing.
Foul by Richard Almeida de Oliveira (Azerbaijan).
Attempt missed. Aaron Ramsey (Wales) right footed shot from outside the box is close, but misses to the right. Assisted by Joe Morrell.
Harry Wilson (Wales) is shown the yellow card.
Shahriyar Rahimov (Azerbaijan) is shown the yellow card for a bad foul.
Javid Huseynov (Azerbaijan) is shown the yellow card.
Connor Roberts (Wales) wins a free kick in the defensive half.
Foul by Shahriyar Rahimov (Azerbaijan).
Substitution, Wales. Will Vaulks replaces Ethan Ampadu.
Substitution, Azerbaijan. Javid Huseynov replaces Dimitrij Nazarov.
Substitution, Wales. Rabbi Matondo replaces Daniel James.
Attempt missed. Dimitrij Nazarov (Azerbaijan) right footed shot from outside the box is just a bit too high from a direct free kick.
Joe Morrell (Wales) is shown the yellow card for a bad foul.