Scotland will host Ukraine in the play-off semi-final for the 2022 World Cup, while Wales have been drawn at home to Austria.
If Scotland and Wales win their matches, they will face each other in Cardiff in a final for a spot in Qatar.
Wales are bidding to reach their first World Cup in 64 years, while Scotland have waited 24 years to play in one.
Other semi-finals include Italy v North Macedonia and Portugal at home to Turkey.
That draw means either European champions Italy or Cristiano Ronaldo’s Portugal will not be at the World Cup, with the winners of their semis meeting in a final.
The semi-finals and finals, both played over one leg, will take place over the course of five days from 24-29 March.
Full semi-final draw
Scotland v Ukraine
Wales v Austria
Russia v Poland
Sweden v Czech Republic
Portugal v Turkey
Italy v North Macedonia
Wales or Austria v Scotland or Ukraine
Russia v Poland v Sweden or Czech Republic
Portugal or Turkey v Italy or North Macedonia
What chances for the home nations?
Scotland and Wales were seeded for the first part of the draw, ensuring a home tie, but the second half of the draw was open and the winners of Wales v Austria were give the home tie against Scotland or Ukraine in their final.
Wales, who have only played at the 1958 World Cup, last faced Austria in a World Cup qualifier in September 2017 when Ben Woodburn scored the only goal on his debut.
Austria are in the play-offs courtesy of winning their Nations League group ahead of Norway, Romania and Northern Ireland.
Wales manager Robert Page, said: “We’ve worked ever so hard to finish second and get that home draw.
“We’ve got everything to play for.”
Scotland’s history with the tournament is far richer – even if those memories have faded a little – with eight appearances at the big show between 1954 and 1998.
They will have to defeat a Ukraine side who were unbeaten in their qualifying group as they finished runners-up behind France, having drawn twice with the world champions.
The side managed by Oleksandr Petrakov are currently ranked 25th in the world, 13 places above the Scots.
“We have shown over the course of the play-offs for Euro 2020 that we can handle the tension for semi-final and final games,” Scotland boss Steve Clarke said.
“Ukraine is up there with the toughest [draw] and then from that we know Wales have done really well recently. We know the Austrians well.
“It’s something for everyone to focus on and think about over the winter months and look forward to some good games in March, hopefully.”
The end for Portugal or Italy
Italy, who won the Euros earlier this year, and 2016 European champions Portugal will play their semi-final games at home against North Macedonia and Turkey respectively.
Should the two heavyweights advance, Portugal will have home advantage in the final.
Failure to advance would be a major blow for four-time World Cup winners Italy, who did not qualify for the 2018 edition – the first time they missed out on qualification in 60 years.
Manager Roberto Mancini, said: “It’s a very difficult draw for us. North Macedonia is a very good team, and if we win we have to play away.
“It could have been a little better, for sure. We are confident and positive, especially in the more difficult moments.
“As we would have gladly avoided Portugal, probably they too would have avoided us. We will have to play a great match against North Macedonia, then we will see in the final.”
Failure to qualify for Portugal could mean 36-year-old Ronaldo has played at his last World Cup.
Elsewhere Robert Lewandowski’s Poland could face Zlatan Ibrahimovic’s Sweden in a play-off final if they beat Russia and Czech Republic respectively.