On May 26, when Sweden’s Loreen Talhaoui took to the stage at the 57th annual Eurovision Song Contest in Baku, the lights fell and eventually the faux snow followed. Performing “Euphoria,” a clubby meditation on the power of love, she howled into a wind machine and suggested that romance helps us transcend everyday troubles: “Forever and ever together, we sail into infinity,” she sang. “We’re higher and higher and higher, we’re reaching for divinity.” Her occasional writhing and jerky dance moves screamed “woman in a straight jacket.” But the choreography also reflected the madness that frequently accompanies infatuation. “The dance represents freedom, and not to have any rules,” she said at a press conference after her landslide victory. “Don’t have any rules. Don’t think so much. Just be whatever you want to be. It will work. And it did.”

Eurovision, the pan-European singing contest that is watched by more than 120 million viewers annually, has earned a reputation as a festival of kitsch where sex appeal and cleavage matter more than talent. But Loreen’s win represents a triumph of minimalism over gaudiness, and suggests Europe’s mood has shifted during a time of austerity.

Russia’s Buranovskiye Babushki — a group of six grandmothers with a combined age of nearly 400 — also played the simplicity card. They wore traditional peasant wear while dancing around a fake oven pretending to bake bread. The comforts of home — and one rather adorable babushka who repeatedly vogued for the camera — helped them finish second with their number “Party for Everybody.” Typical euro-pop fluff didn’t fare so well. Eleftheria Eleftheriou, the 23-year-old Greek contestant, sang a song called “Aphrodisiac” while dancing in front of a giant clam. She wore iridescent panties to match her iridescent dress, but only finished in 17th place.

For Azerbaijan, which won the right to host Eurovision by winning last year’s contest, money wasn’t an issue. Its economy has nearly tripled in size since 2006, owing mostly to large windfalls of oil and gas. Hoping to burnish its international image, and to distract attention from its spotty human rights record, officials sank at least $67 million into hosting the event — more than double what host cities typically spend. They constructed the stunning Crystal Hall Arena, the Eurovision venue designed to resemble a diamond necklace, in just eight months. “It’s not only an advertisement,” Fakhraddin Gurbanov, Azerbaijan’s ambassador to Britain, told me recently. “It’s the introduction of our country to the world.”

In its bid to portray itself as a modern country at ease with the West, Baku imported thousands of London-style taxis and painted them with the Eurovision logo and its slogan “Light your fire!” (The drivers, eager to protect their new wheels, frequently placed shower caps on the head rests and bubble wrap on the floor.) The city also provided complimentary bus tours for the 1,600 journalists in town to cover Eurovision. The four-hour excursion took visitors past landmarks of Baku’s burgeoning wealth, like the Excelsior Baku Hotel and the JW Marriott — both of which opened in time for Eurovision. When the bus snaked past a row of shops that included Gucci, Bulgari and Christian Dior, the guide articulated what most visitors had already figured out. “My country is very capitalist,” he said. His enthusiasm sometimes came off as a threat. “You will not forget about Baku at the end of your life!”

Officials also gave each journalist a crystalline paper weight that included an orb with Azeri oil in the middle. And they distributed countless pamphlets. “All the promotional materials they gave us weigh about 32 kilos. I can’t take that on the plane,” says Dean Vuletic, a historian and Eurovision authority at the European University Institute in Florence. “If anything it’s made me more critical of the state. None of it was very objective.” Journalists and fans alike scoured through copies of Baku — a glossy magazine published by Condé Nast and edited by the President’s daughter — and a 14-page pamphlet that, among other things, discussed the country’s “multiparty democracy” and the Nagrono-Karabakh conflict in which “Armenian secessionists began a bloody war which has resulted in the occupation of roughly one-fifth of the territory of Azerbaijan.”

Azerbaijan said it would guarantee the safety of Armenian contestants at Eurovision. But Yerevan withdrew ahead of the contest anyway amid security concerns. Fans and journalists alike left Baku understanding why the Armenians might have felt uncomfortable. Regional maps hung on walls in the city depict all of Azerbaijan’s neighbors — including Iran and Turkey. But they leave the land mass that is Armenia blank. The Euroclub — a focal point of every Eurovision, where fans dance the night away to past and present Eurovision songs — turned political too. Authorities banned DJs, supplied by Eurovision fan clubs, from playing Armenian Eurovision songs, which also happen to be some of the most popular of all time. Speaking to a group of Azeri 20-somethings during a rather loud performance one evening, I told them I was American. Their brows furrowed and a scowl crept over each of their faces. “Armenian?”

Misunderstandings like that are easily cleared up. More troublesome are threats — and perceived threats — leveled against Eurovision’s large fan base of gay men. Religious extremists threatened to kill homosexual visitors and to disrupt the song festival. As one man wrote on a Russian news site in April: “Eurovision is a nightmare for all Muslim people. Forces of Satan, perverts, and homosexuals of the world must know what they cannot easily come to our land where righteous Muslims spilled their blood and have as they want. They will be attacked for sure.” Just last week, a group of hackers, worried that Baku would sanction a gay pride parade during Eurovision, brought down several Azeri Eurovision websites ahead of the contest. Gays weren’t the only folks running scared. Israel’s delegation sent in swat teams to protect its Eurovision contestants. Since 2009, Azeri officials have thwarted two attempted attacks on the Israeli embassy in Baku — one in 2009, the other earlier this year.

To prepare for such threats, Azeri security forces conducted secret operations throughout the country, and detained members of illegal extremist groups in the months leading up to Eurovision. During the Eurovision final and the two semifinals, hundreds of plainclothes security forces were embedded in the audience. Forces in their military fatigues could be seen roaming the halls.

The sight of armed forces didn’t exactly fit with Eurovision’s mission to be Europe’s Joy Factory. But the event went off without incident. Well, for fans anyway. Throughout the two weeks of rehearsals and the competition, the government had no choice but to listen as journalists and contestants raised concerns about human rights. Sweden’s Loreen, the eventual winner, met with opposition politicians on two occasions. When a journalist asked about those encounters, the Azeri M.C. suggested that that type of question killed the atmosphere. The sea of Western journalists hissed and Loreen later pledged to help civil society any way she can.

The most embarrassing moment for the government, however, came during the show’s live broadcast, when representatives from all 42 countries presented their results. The German presenter Anke Engelke spoke directly to the people of Azerbaijan. “Tonight, nobody could vote for their own country, but it is good to be able to vote and to have a choice,” she said. “Good luck on your journey, Azerbaijan. Europe is watching you.”