Ukraine’s Kalush Orchestra won the contest with its song Stefania, which has become a popular anthem among Ukrainians during the war, and its victory was a morale booster.
“Congratulations to Ukraine for winning the @Eurovision Song Contest 2022,” the PM posted to Twitter.
“It is a clear reflection of not just your talent, but of the unwavering support for your fight for freedom.”
Mr Johnson also extended congratulations to Britain’s runner-up in the competition, writing: “Incredibly proud of @SamRyderMusic and how he brilliantly represented the UK tonight.”
The UK’s Sam Ryder finished in second place.
Ukraine have been the competition favourites since Russia’s invasion – which prompted organisers to ban the aggressor from competing.
Receiving the trophy, Kalush Orchestra said: “Thank you for supporting Ukraine. This victory is for every Ukrainian. Slava Ukraini.”
Culture Secretary Nadine Dorries repeated “Slava Ukraini!” (glory to Ukraine!) in tweeting her congratulations.
“What a fabulous night. So close for the amazing @SamRyderMusic but with #Ukraine coming 1st this is still a wonderful result,” she said.
Scottish television presenter Lorraine Kelly posted a message to Russian President Vladimir Putin: ‘Congrats to UKRAINE – get it right up you Putin – and our @SamRyderMusic did us proud.”
Ryder’s placement marks the first time in 20 years that the UK has placed in the top three, clinching the spot with his pop song Space Man.
Katrina Leskanich, who sang the last winning UK entry, Love Shine A Light by Katrina and the Waves, tweeted: “Three cheers for Sam Ryder what a fantastic result for #UK.”
Actor John Barrowman tweeted: “Congratulations on 2nd place #Eurovision #samryder because of you and the song #Spaceman the United Kingdom is back in the game.”
Former winner Cheryl Baker, of Bucks Fizz, tweeted: “Wasn’t this the best @Eurovision for years?
“Not just because the brilliant @SamRyderMusic came 2nd, but it was a show of love, joy, inclusivity and no animosity.”
Meanwhile, defiant Ukrainian President Volodymyr Zelensky has vowed to one day host the Eurovision Song Contest in the embattled city of Mariupol, which is almost entirely in Russian hands aside from a stalwart group of a few hundred Ukrainian fighters who continue to hold out in a steel factory.
“Our courage impresses the world, our music conquers Europe,” Mr Zelensky said on Facebook. “Next year, Ukraine will host Eurovision.”
Mr Zelensky added that “one day” the contest will be held “in a Ukrainian Mariupol”.
The president’s optimistic words come as Russian troops are retreating from Kharkiv, the country’s second largest city, after bombarding it for weeks, and Moscow’s forces continue to engage in a grinding battle for the country’s eastern industrial heartland.
Ukraine’s military said the Russian forces are now pulling back from the north-eastern city to focus on guarding supply routes, while launching mortar, artillery and air strikes in the eastern region of Donetsk in an attempt to “deplete Ukrainian forces and destroy fortifications”.
Defence minister Oleksii Reznikov said Ukraine is “entering a new – long-term – phase of the war”.