By Mark SavageBBC Music Correspondent
The UK won the jury vote before Ukraine stormed into the lead following huge public supportUkraine's Kalush Orchestra have won the Eurovision Song Contest, in a symbolic show of public support following the country's invasion by Russia.
The rap-folk band, who were given special permission to leave the war-torn country, soared to first place with 631 points.
They ended their performance in Turin with a plea: "Please help Ukraine, help Mariupol, help Azovstal right now."
Sam Ryder came second for the UK, the country's best result since 1998.
A former construction worker, he had been keenly favoured ahead of the competition thanks to his soaring power ballad, Space Man, which evoked the classic British pop of Queen and Elton John.
It topped the jury vote, amassing 283 points, but was pipped at the post when public votes were added to the total. (The UK came fifth with the public, with Ukraine receiving the most points).
However, his second place position reverses a long decline in the UK's Eurovision fortunes. The country hasn't been in the top 10 since Jade Ewen came fifth in 2009. In both 2019 and 2021, the UK came last.
Watch: Sam Ryder and Graham Norton on Eurovision triumph"This is the tip of an iceberg," he told the BBC afterwards. "The UK is going to be a force next year. It's gonna be mad."
"This is a red letter moment," added Graham Norton, who presented the contest on BBC One. "I am so happy for [Sam], for the UK and for the BBC who have worked so hard to turn our fortunes."
EBUSam Ryder's boundless positivity was warmly embraced by Eurovision fansSpain also enjoyed a dramatic recovery in its fortunes, coming third with the slickly-choreographed SloMo.
Performed flawlessly by Cuban-Spanish singer Chanel Terrero, it was the country's first top 10 placing since 2014.
The top five looked like this:
But nobody could compete with Ukraine's act, who had been favourites to win for weeks.
Kalush Orchestra asked the audience to help Ukrainian forces in besieged MariupolTheir winning song, Stefania, was originally written as a tribute to frontman Oleh Psiuk's mother, but it has been re-purposed as a rallying cry for Ukraine amidst the Russian invasion.
A unique combination of old Ukranian folk melodies and traditional flute with contemporary rap and hip-hop beats, its lyrics about "broken roads" and fields "turning grey" seemed oddly prescient given the devastation facing the country's citizens.
"After it all started with the war and the hostilities, it took on additional meaning, and many people started seeing it as their mother, Ukraine, in the meaning of the country," Psiuk said last week. "It has become really close to the hearts of so many people in Ukraine."
Receiving the coveted trophy, Psiuk declared: "Thank you for supporting Ukraine. This victory is for every Ukrainian. Slava Ukraini."
Speaking backstage, the singer said he hoped Ukraine could stage the contest in 2023.
"I'm sure that next year Ukraine will be happy to host Europe in a new, integrated and happy Ukraine."
Russia, meanwhile, was banned from this year's contest, with organisers saying the country's participation could "bring the competition into disrepute"
Several artists expressed solidarity with Ukraine, waving flags and making brief statements on the stage. "Peace for Ukraine! We love you!" announced Iceland's Systur after their performance.
"Don't lose your hope for a better tomorrow," added Estonian singer Stefan, as he finished playing his country-tinged ballad, Hope.
The show even opened with a rendition of John Lennon's Give Peace A Chance, performed by 1,000 musicians on the streets of Turin, driving home the night's message of unity.
Elsewhere the competition was its usual mix of crazy, kitsch pop and overwrought ballads.
EBUNorway's Give That Wolf A Banana was a big favourite amongst fansNorway's Subwoolfer dressed in yellow wolf costumes for their surreal retelling of Red Riding Hood, titled Give That Wolf a Banana.
Konstrakta, representing Serbia, sat at a hand basin obsessively washing her hands, as she sang In Corpore Sano - a song that critiqued the lack of healthcare for artists in her homeland, which ended up in fifth place.
Sweden's Cordelia Jakobs earned fourth place with her aching end-of-the-night pop anthem Hold Me Closer.
Other highlights included Finland's The Rasmus, whose visuals drew inspiration from the horror film It; and Portugal's Saro, whose low-key ballad Saudade, Saudade was a tribute to her late grandfather.
Italy's Mahmood and Blanco, meanwhile, were almost drowned out by fans as they sang Brividi, a tender song about the need for vulnerability.
EBUSweden's Cordelia Jakobs had one of the night's most simple stagings, focusing attention on her bittersweet pop songLast year's winners Maneskin also returned to the stage to perform their new single Supermodel - despite missing all the dress rehearsals after frontman Damiano David tore a ligament in his ankle shooting a music video.
The singer was seen hobbling around on crutches backstage, but managed to get through his performance unaided... if largely immobile.
Allow Twitter content?
This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read and before accepting. To view this content choose ‘accept and continue’.Accept and continue
He also got one of the night's biggest laughs, after being asked to give advice to this year's contestants.
"Have fun and don't get close to the table," he deadpanned, referencing the controversy that arose last year when he was falsely accused of snorting cocaine in the green room.
Earlier this week, it was revealed that President Macron of France had tried to get Maneskin disqualified from the contest as a result of the incident.
The singer denied the claims and subsequently passed a voluntary drug test.
Hosts Laura Pausini and Mika also performed medleys of their hits; and Italy's first Eurovision winner Gigliola Cinquetti gave a moving rendition of her winning song from 1964, No Ho L'Eta.
During the competition, the European Broadcasting Union made an announcement that there had been irregular voting from six countries during the second Eurovision semi-final on Thursday night.
As a result, votes from countries including Azerbaijan and Georgia were read out by the EBU's executive supervisor of the contest, Martin Österdahl, instead of their jury.
The EBU did not say whether the voting irregularities had affected the outcome of the semi-final, which saw Ireland eliminated from the competition.
Who will host Eurovision 2023?
EPAUkraine's win raises a question over who will host next year's Eurovision ceremony.
The winning country usually stages the show, but Ukraine is unlikely to have that capability, after its state broadcaster, UA:PBC, was targeted in the opening days of the war.
When a country is unwilling or unable to run the show, another broadcaster usually steps in... most recently in 1980, when the Netherlands took over from Israel, who declined to host the contest after winning for two years in a row.
In a statement on Saturday night, organisers the EBU said no decision had been made for 2023.
"Obviously, there are unique challenges involved in hosting next year's competition. However, as in any other year, we look forward to discussing all the requirements and responsibilities involved in hosting the competition with UA:PBC and all other stakeholders to ensure we have the most suitable setup for the 67th Eurovision Song Contest."
But Ukranian President Volodymyr Zelensky vowed he would stage the contest if at all possible: "We will do our best to one day host the participants and guests of Eurovision in Ukrainian Mariupol. Free, peaceful, rebuilt!"
Follow us on Facebook, or on Twitter @BBCNewsEnts. If you have a story suggestion email entertainment.news@bbc.co.uk.
BBC in other languagesInnovationncG1vNJzZmivp6x7o67CZ5qopV%2Bjsri%2Fjp6lrZ2iqa6qusyepa1lkafBtHmVamtuamZshQ%3D%3D