Residents waving the national flag celebrate in Baku, the Azerbaijani capital, after an Azerbaijani duo won the Eurovision Song Contest. (DAVID MDZINARISHVILI/REUTERS)

Last month, this authoritarian nation tucked between Russia and Iran won the slightly wacky “American Idol”-meets-Model U.N. pop song contest called Eurovision, and now Azerbaijanis are asking themselves a question:

Can rock-and-roll — the lingua franca of dissent — make them free?

Not only did the Eurovision victory leave this country — which feels deeply under-appreciated — dizzy with pride, but it also makes Baku host of the 43-nation event in May, opening it up to a madcap extravaganza that requires tolerance for high camp — think spiked orange hair and green sequined sunglasses — and unfettered self-expression.

This year’s contest in Duesseldorf, Germany, brought a live audience of 36,000, hordes of exuberant tourists and 120 million viewers on television and on the Web, more than the number who watch the Super Bowl.

Government critics are seizing on Europe’s sudden attention and the leadership’s desire for respect and friendship from it to press for democratic reforms. The government has a long record of arresting journalists and other outspoken opponents, and in March and April, unnerved by the popular uprisings in Tunisia and Egypt, it cracked down hard on youthful demonstrators.

“As you know, rock is the music of free people,” more than 30 civic leaders said in a May 26 letter to President Ilham Aliyev, asking him to release journalists and activists before the Eurovision Song Contest arrives.

U.S. Ambassador Matthew J. Bryza also made the connection. “I hope this is the opening sign of a new era, a new era for Azerbaijan as it deepens its reforms,” he said, commenting on the president’s pardon and release of an opposition newspaper’s editor jailed for four years. “And what a wonderful way to begin this year of preparation for Eurovision 2012.”

Strategic importance

Azerbaijan, a secular Muslim nation that is mostly Shiite but wary of neighboring Iran, has one hand firmly extended toward Europe and the West — while the other keeps a tight fist on power and wealth at home.

Energy security and strategic location make Azerbaijan — which is perched on the heights of the Caucasus mountains and curves along the low Caspian shores — important to the United States. A 1,100-mile oil pipeline operated by BP in partnership with U.S. and other companies pumps a million barrels a day from Baku, the capital, through the Georgian capital, Tbilisi, to the Turkish port of Ceyhan, helping diversify supplies and cut dependence on energy from the Middle East.

There’s money to be made here, and it washes fetchingly over Baku, which in the past decade has transformed from a slightly seedy Soviet capital into a moneyed city with well-landscaped parks, five-star hotels and the requisite Kenzo, Armani and Escada stores.

Families stroll along the oil-perfumed Caspian shore, eating popcorn, drinking Coke and stopping to sip tea in outdoor cafes. Twelfth-century walls enclose a tidily preserved old city where 14th-century caravan stops have been turned into restaurants. Art nouveau buildings from the last oil boom — the Swedish Nobel brothers made their fortunes after setting up here in 1879 — offer cosmopolitan elegance. And now, Soviet–era buildings are giving way to statement-making architecture, including three flame-shaped skyscrapers under construction at a cost of $350 million.

Beyond the charms of Baku — you have to love a city with a Pizza Hat — a struggle is going on between the free-speaking Facebook set and their controlling elders, between the desire to embrace the West and old suspicion of it.

The Eurovision victory of pop duo Eldar Gasimov and Nigar Jamal in Germany won Azerbaijan the right to host the competition in 2012. (Frank Augstein/AP)

The young have numbers and time on their side. The median age in this country of nearly 9 million is less than 30, and Facebook users have increased 20 percent in the past three months, to 400,000. The government, however, has the power.

Emin Huseynov, chairman of the Institute for Reporters’ Freedom and Safety, has a list of nearly 50 activists who are being investigated or held in prison.

“After the revolutions in Tunisia and Egypt,” Huseynov said, “the situation here changed dramatically.”

First, the government tried to tune into the people, launching an anti-corruption campaign, he said, but then Syria started clamping down ruthlessly on protesters and Egyptians forced out their longtime president and arrested him.

“Now Azerbaijan thinks imprisonment is not such a bad option,” Huseynov said.

In May, Bakhtiyar Hajiyev, a 29-year-old activist who returned here after earning a master’s degree at Harvard Kennedy School, was sentenced to two years in prison on charges of evading the draft. His defenders say his real crime was organizing anti-government demonstrations via Facebook.

Another social media activist, 20-year-old Jabbar Savalanli, was sentenced to 2 1 / 2 years on what Human Rights Watch called bogus drug possession charges.

Isa Gambar, chairman of the opposition Musavat party, which was founded in 1911 and has five members in jail, said huge disparities have developed between those in power, who have access to privilege and wealth, and the vast majority of people — the average monthly income is $400.

“The whole country is monopolized by one family,” Gambar said. “We not only lack freedom of assembly, we lack economic freedom.”

‘It will change everything’

Heydar Aliyev, who took over leadership of the Azerbaijani KGB in 1967 and became the republic’s Communist Party chief in 1969, won the presidency in 1993 after a couple of years of traumatic chaos as Azerbaijan gained independence after the collapse of the Soviet Union in 1991. He died in 2003, just after making son Ilham his prime minister and successor.

All public buildings display portraits of Heydar, which must be bought from an official vendor, and his image gazes serenely from many a billboard. His birthday is marked with a flower festival costing millions of dollars, and on holidays, television broadcasts include a small picture of him in a corner of the screen.

Leila Aliyeva, an independent political analyst, said government suggestions of reform threaten a large and comfortable bureaucracy. “Many people have high stakes in preserving the status quo,” she said.

The country has made a serious effort to spread the oil money around, sending students to study abroad, all expenses paid, and developing technology to create jobs — Azerbaijan has a contract with Orbital Sciences of Dulles to launch a satellite to expand Internet access.

Officials are proud of these efforts and deeply resentful of a world that they say plays favorites. “Deputies in Armenia go to prison,” said Samad I. Seyidov, a member of parliament, “and no one says they have political prisoners. But we, we’re told we have political prisoners. It’s not fair.”

All countries have their shortcomings, said Novruz I. Mammadov, head of the president’s foreign relations department, “but please, don’t close your eyes to the other things.”

And now comes Eurovision, a contest dating to 1956, in which countries in the European Broadcasting Union vote, but not for themselves, leaving regional loyalties to prevail — the Model United Nations part.

Eldar Gasimov, a gel-tousled graduate student who turns 22 this year — he’s Ell for the contest — and Nigar Jamal, a 30-year-old blond and beautiful housewife with an economics degree and two small children — she’s Nikki — met when they won the Baku finals. Azerbaijan paired them up and hired a Swedish team to write them a song, heavy on the ooh-ooh-oohs.

Both looked startled when told that the nation’s hopes for freedom and democracy rested on them. “It will change everything,” said Elnur Baimov, editor in chief of the News.Az online agency: Taxi drivers are enrolling in English classes. The police are next. Azerbaijan will open up to the world.

Maybe it’s only rock-and-roll, but they like it.