The Eurovision Song Contest grand final, held in Liverpool, England, on Saturday, was meant to be Ukraine’s party.

After Ukraine won last year’s edition of the beloved, campy singing competition, the country won the right to host this year’s spectacle. But with Russia’s invasion showing no sign of ending, the event was relocated to Liverpool.

In the midst of a war, and with millions watching live, Ukraine’s entrant, Tvorchi, was among the favorites to win this year’s edition of the glamorous and, often, oddball event — a sign of the European public’s ongoing solidarity with Ukraine against Russia’s invasion.

Instead, Sweden crashed the celebration. Around midnight in the M&S Bank Arena, Eurovision’s hosts announced that the pop singer Loreen had won with “Tattoo,” a dance track that grows in intensity with each verse.

Loreen was the bookmakers’ favorite for the competition, thanks to both her catchy track and Eurovision pedigree, having won once before, in 2012. Her victory means that Sweden, a Eurovision-obsessed nation, will host next year’s contest.

Ukraine’s entry, the pop duo Tvorchi, finished in sixth place.

Eurovision, which started in 1956 and is now onto its 67th edition, is the world’s most-watched cultural event. Each year, entrants representing countries across Europe and beyond face off, performing original songs in the hope of securing votes from watching viewers and juries.

Britain’s public broadcaster, the BBC, which organized this year’s contest, promised it would host a party for Ukraine, and in Liverpool on Saturday, the war-torn country’s presence was inescapable. Eurovision fans walked the city carrying Ukrainian flags, and dozens of Ukrainian art installations could be seen in prominent locations around the city.

In Kyiv on Saturday, the event offered a diversion from the battlefield. At the Squat 17b bar in the city, Eurovision fans gathered to watch the show, dedicating their first round of applause to the Ukrainian Army.

Kyiv’s daily curfew starts at midnight, and the bar shut at 8:30 p.m. so that people could get home; fans could not watch the whole event there. Still, at one table, a group of friends sang along while they could.

“It’s a piece of happiness,” said Olha Tarasenko, 24. Tarasenko said she remembered Ukraine’s victory at last year’s event. When Kalush Orchestra, a rap-folk group, triumphed, “I was crying, and felt like everything is possible,” she said.

European solidarity with Ukraine was clear throughout Saturday’s spectacle in Liverpool. It opened with a video of Kalush Orchestra performing on a subway train in Kyiv, before the band appeared onstage to almost deafening cheers.

Later in the broadcast, Julia Sanina, one of the evening’s TV hosts, went into the audience and spoke with displaced Ukrainians living in Britain who had been given heavily-discounted tickets to the final. And, in a special guest performance, Duncan Laurence, a Dutch pop star, gave a rousing rendition of Gerry and the Pacemakers’ “You’ll Never Walk Alone,” accompanied by a choir in Kyiv via video. “Walk on, walk on, with hope in your heart,” the choir sang, “And you’ll never walk alone.”

The show’s hosts and competitors were careful not to actually mention or criticize Russia, which last year was banned from participating in the contest because of its invasion of Ukraine. Eurovision is meant to be a nonpolitical event, and overt political statements are banned.

On Friday, that rule stirred controversy in Britain after President Volodymyr Zelensky of Ukraine asked to speak during the final, but was rebuffed. The European Broadcasting Union, which oversees Eurovision, said in a news release that “regrettably” an address by President Zelensky would have breached its rules.

Shortly after the union’s decision, a spokesman for Prime Minister Rishi Sunak of Britain told reporters that Eurovision’s apolitical nature wasn’t a good enough excuse. “The values and freedoms that President Zelensky and the people of Ukraine are fighting for are not political, they’re fundamental,” the spokesman said, according to a report on the BBC.

Still, the nonpolitical rule was stretched to breaking point on Saturday night, with several participants performing songs that hinted at Russia’s invasion. During Tvorchi’s performance of “Heart of Steel,” the band sang lyrics including: “Despite the pain, I continue my fight.”

On Saturday night, even with Tvorchi’s sixth place finish, Ukrainian culture was on display right until the end of the spectacle.

After Loreen accepted the Eurovision trophy, Julia Sanina, the Ukrainian TV host, appeared onstage to thank Liverpool for being “an amazing host on behalf of Ukraine.” She then quoted the slogan of this year’s contest: “We will always be united by music.”