Ukraine has won the competition with 631 points.
The UK received 466 points.
The UK proved successful in the jury vote, coming out on top. However, when the viewer vote came in, Ukraine received the most votes.
Spain finished in third place.
The 32-year-old UK hopeful and TikTok star Sam Ryder was just one of 25 acts vying for the top prize during the climax of the week-long contest in Turin, Italy.
He took to the stage in a dazzling one piece encrusted with planets, moons and stars made of beads and pearls.
Ryder was the 22nd act to perform as a crowd of 7,000 fans at the Pala Olympica arena sang along to the song Space Man.
Concluding his set, the singer said: “Shine brightly my friends. Thank you all.”
Graham Norton, who once again anchored the contest on BBC One, said: “What a powerhouse performance. You can’t ask for much more than that.
“There is a sea of Union Jack flags.”
Ryder hoped to improve the UK’s chances after it was bottom of the leader board in both of the past two contests – coming last in 2019 with Michael Rice’s Bigger Than Us, and James Newman’s Embers scoring “nul points” in 2021.
He co-wrote the uplifting pop song with Grammy-winning songwriter Amy Wadge, who has previously worked with Ed Sheeran and Max Wolfgang.
The Eurovision final featured the 20 successful nations from the week’s two semi-finals, as well as the so-called big five of the UK, France, Germany, Italy and Spain.
During the show, folk-rap group Kalush Orchestra performed an impressive rendition of their song Stefania.
The Ukrainian act was a favourite to win, having been frontrunners since Russia’s invasion – which prompted organisers to ban the country from competing.
The group was dressed in elaborate outfits, including long multi-coloured fringed ensembles, a pink bucket hat and others in traditional patterns.
Their performance, which combined rap and Ukrainian folklore, went down well with the audience who cheered the group on with many waving Ukrainian flags.
Norton said: “We weren’t sure they were going to make it but they have made it.
“Their commentator did not make it, he is commentating from a bomb shelter.”