The team now need one more win to earn their place in Qatar, following a thrilling semi-final playoff in Glasgow.
Ukraine dominated much of the match. Veteran captain Andriy Yarmolenko scored the first, a deft lobbed goal in the 33rd minute and then helped set up Roman Yaremchuk’s header in the 49th to make it 2-0.
A late Scottish revival of risky attacks brought the team a goal in the 79th by Callum McGregor, before Ukraine substitute Artem Dovbyk broke clear to score with the last kick of the game.
3,000 Ukrainian fans were amongst the 51,000 strong crowd at Hampden Park stadium in Glasgow, Scotland.
They applauded each other with hands raised high above their heads, as Dovbyk led teammates toward the corner of the stadium to celebrate their victory.
Ukraine coach Oleksandr Petrakov said the win was for “the armed forces in the trenches and in the hospitals, who give their last drop of blood, those in Ukraine who suffer every day.”
The country, which was invaded by Russia in February, will face Wales in the qualifying final on Sunday with a place at the World Cup at stake.
The winner in Cardiff will go to Qatar in November to play in a group against England, the United States and Iran.
Ukraine is riding a wave of global goodwill following the Russian invasion and its players’ intense motivation to reward the nation with a place on football’s biggest stage was apparent.
The Ukrainian players all walked onto the field each with a blue and yellow national flag draped on their shoulders.
The warm welcome saw Ukraine’s national anthem “Shche ne vmerla Ukrainas” applauded loudly by Scotland fans. Many of those same fans stayed after the game to salute their victorious opponents off the field.
“Also I give my gratitude to the people of Scotland — an amazing, hospitable place,” coach Petrakov said.
Many Ukrainian fans had travelled far and had made plans to stay in the UK for the decisive playoff against the Welsh squad on Sunday.
George Butromeyev told The Associated Press before the game he came from Toronto with friends to support the players who “need to show the people of Ukraine that we are warriors.”
“It’s not only about football,” said Yaroslav Grygorenko, who travelled from Amsterdam.
“It’s important to be on the top of the discussions here in Europe, to not let (people) forget what is happening in Ukraine.”