Wales needed to win in Azerbaijan to keep their automatic qualification hopes alive, and Harry Wilson's goal in a 2-0 away win made sure they did just that.
Kieffer Moore scored earlier in the first half, before the Cherries man gave Wales further comfort in the scoreline, playing a major role in the build-up, passing wide for Daniel James to crash in a shot that the 'keeper tipped onto the woodwork, Wilson following in to pick up the pieces from close range.
Chris Mepham also started the fixture in Baku, playing the full 90 and helping his side to a clean sheet as he won his ninth cap for his country.
The win sets up a winner-take-all match with Hungary in Cardiff on Tuesday, the night's winners assured an automatic qualification spot in next summer's Euros, while Slovakia lie in wait and could pinch the berth if Wales and Hungary can only draw.
On Saturday night, the Netherlands were another side in action and they confirmed their attendance at the Euros with a 0-0 draw with Northern Ireland in Belfast, Bournemouth defender Nathan Ake replacing Ryan Babel late in the game as the Dutch maintained the point they needed to qualify.