Ukraine fans celebrate after Andriy Yarmolenko scored their side's first goal against Scotland.
Glasgow, Scotland CNN  — 

Ukrainian President Volodymyr Zelensky thanked the national team for “two hours of happiness” after it produced a magical performance to beat Scotland 3-1 in its World Cup playoff semifinal on Wednesday.

Ukraine is now just one win away from reaching the Qatar World Cup later this year, needing to beat Wales in Cardiff on Sunday.

Despite a complicated preparation that included a month in a Slovenian training camp, an emotional Ukraine side was very much a worthy winner on the night.

It hadn’t played a competitive game since November last year but was determined to give those fighting back home something to cheer about.

Ukraine Fans with masks of President Volodymyr Zelensky during the World Cup playoff semifinal.

“There are times when you don’t need many words! Pride is enough! Simply thanks to you guys!” Zelensky said in an Instagram post.

“Two hours of happiness that we’ve grown unaccustomed to. They went out. They fought. They persevered. They won. Because they are Ukrainians!

“We are all fighting, everyone on their own front, for this. For our blue and yellow flag, for our coat of arms on our hearts, for ‘Ukraine is not dead yet…’, which cannot be silenced,” he said.

“We fight, we fight, we endure, we win.”

Ukraine looked much sharper than its opposition and was cheered on by thousands of Ukraine fans who created a brilliant atmosphere in Hampden Park.

Goals from Andriy Yarmolenko and Roman Yaremchuk had put the visitors in control of the match, but there were some nervy moments in the final stages.

Callum McGregor scored for Scotland with just 10 minutes left, initiating an onslaught on the Ukrainian goal.

But Ukraine dug deep and defended resolutely before adding a third goal with the last kick of the game through Artem Dovbyk.

Yarmolenko is mobbed by teammates after scoring the opener.

It was a goal that led to bedlam in the away end with fans crying, dancing and singing long after the players had left the pitch.

“I have no emotions. All my emotions are left on the football pitch. This victory was not for me, not for the players, it was for our country,” Ukraine’s exhausted head coach Oleksandr Petrakov told reporters after the game.

“We played for those who fight in trenches, those who fight for their last drop of blood. Yes, we took a baby step towards our great aim. We still have the Wales game in front of us and we’ll do everything. We are extremely proud Ukrainians.”

Ukraine travels to Wales on Thursday and has a quick turnaround in order to be ready for the playoff final in Cardiff.

“One more to go,” Ukraine’s star player Oleksandr Zinchenko said on Instagram after the game.

CNN’s Mitchell McCluskey and Josh Pennington contributed to this report.