Swedish singer Mans Zelmerlow has won the final of the Eurovision Song Contest in Vienna, narrowly beating Russia and Italy in the international talent show.
Zelmerlow, a 28-year-old singer and TV presenter, performed the winning electro-pop song Heroes while dancing with 3-D special effects and cartoon-like gnomes.
He told reporters he "couldn't believe" he won the contest, adding that he thought "Russia or Italy would win."
"My feelings right now are all over the place, I am so proud, so full of joy, so excited," he said.
Second-place Polina Gagarina of Russia was trading the lead with Zelmerlow for most of the night but couldn't hold on for the victory as the results were slowly announced by each of the 40 countries.
There were some boos from the audience during Gagarina's performance, apparently prompted by the Ukraine conflict and Moscow's antigay policies.
The bearded cross-dresser Conchita Wurst, who won the 2014 contest for Austria, called the negative fan reaction toward Gagarina "incomprehensible" and said she could not be "blamed for the rules" in Russia.
Gagarina's song, A Million Voices, stirred controversy in Russia with lyrics such as "We are the world's people, different yet we're the same," which was seen as contradicting the Russian government's antigay stance and a restrictive law that bans the "promotion of homosexuality."
Russian Orthodox Church Patriarch Kirill said before the contest that he hopes Gagarina loses.
He added earlier in the week that Eurovision promoted values that are "repulsive to our soul and our culture."
Gagarina's producer, Konstantin Meladze, said A Million Voices was written by an international team that included a Swedish songwriter.
He said the song was a "message to the world."
Gagarina told Russian television afterward that she is "so proud" of Russia and was "so happy" with her second-place finish.
Sweden most recently won the 2112 Eurovision competition, and has won the event a total of six times, one short of record-holder Ireland.
An estimated 200 million people watched the the final of the Eurovision contest, which was first held in 1955.
Zelmerlow said his song, Heros, was inspired by a boy who helped him when he was young and had difficulty making friends.
Armenia's entry in the contest was a ballad that was seen by many as referring to the World War I-era mass killings of ethnic Armenians by Ottoman Turkey.
Turkey disputes the use of the term genocide to describe the killings and says the often citied figure of 1.5 million Armenians being killed in that time is exaggerated.
Armenia last month marked the 100th anniversary of the start of the killings.
Next year's Eurovision will be hosted by Sweden, its reward for Zelmerlow's win.