THE pattern has become wearingly familiar. Doughty pro-democracy activists take to the streets of Baku, the capital of Azerbaijan. The police move in, break up the crowds and arrest some of the demonstrators. Some organisers receive jail sentences; the relatives of others, who choose to agitate in safety from outside the country, lose their jobs. As last week's police raid on the opposition Musavat party suggests, the government is desperate to prevent the Arab spring from spreading to Azerbaijan.

The regime has form here. Between 2003 and 2005, "colour" revolutions ushered in new governments in Ukraine, Georgia and Kyrgyzstan. Seen from Baku, the lesson was clear: nip demonstrations in the bud. Protestors paid the price: one young activist was handed seven years in prison; another was given five. As the International Crisis Group argued [PDF] last year, this is part of a broader strategy to crush dissent and maintain control.

Take media freedom. April 20th marked the fourth anniversary of the conviction of Eynulla Fatuyallev, a journalist, on a range of trumped-up charges. A year ago the European Court of Human Rights ordered the Azerbaijani government to release him. But the authorities have ignored that ruling, part of a broader climate of intimidation that causes journalists to censor themselves rather than invoke the government's wrath.

On a political level, too, the government has consolidated its position in recent years. Reforms in June 2010 reduced the parliament to a rubber-stamp for the executive. In March 2009, the authorities won a hastily organised referendum proposing the abolition of presidential term limits. The incumbent, 49-year-old Ilham Aliev, is likely to win the election next year. He could stay in power for decades.

Foreign pressure can make a difference. International pressure forced the release late last year of two young activists convicted on trumped-up charges. But by and large, the international response to Baku's clampdowns has been toothless. The Council of Europe has failed to match its words with sanctions. With bigger issues at stake, such as energy supply to Europe, transit routes for US troops in Afghanistan and resolution of the dispute with Armenia over Nagorno-Karabakh, diplomats pull their punches.

Are the demonstrators doomed to fail? Azerbaijanis have gained a lot under Mr Aliev's regime. Huge oil revenues have led to a flurry of infrastructure and reconstruction projects.Social-welfare payments trebled between 2006 and 2010. Living standards, by the World Bank's assessment, have improved considerably. The president enjoys high approval ratings, and not only in government-sponsored polls.

Yet the president has appeared sufficiently rattled by uprisings elsewhere to launch a public relations counter-offensive. He has stepped up television appearances, and announced a flurry of new initiatives, including a high-profile anti-corruption drive.

Azerbaijan is ranked 134 in Transparency International's Global Corruption Barometer, tied with such luminaries as Zimbabwe. Corruption and patronage dominate public life. Some critics have dismissed the government's efforts as window-dressing. But others have been surprised at the success of measures designed to prevent traffic police and customs officials from taking bribes.

The country faces another problem. Oil revenues account for 55% of GDP, but they will not last forever. Production has already peaked, according to some estimates, and reserves may run out as early as 2028. The non-oil sector needs much more attention. The government will struggle to maintain the largesse to which the public has grown accustomed.

A recent report from the European Stability Initiative strikes a cautiously optimistic note. A new generation of foreign-educated leaders is behind the recent wave of demonstrations. They expect more from their leaders than handouts and stability. As elsewhere, social media enable them to reach fellow citizens (although few outside of Baku are online).

Azerbaijan is unlikely to follow the examples of Egypt and Tunisia, just as it failed to replicate those of Georgia and Ukraine. A better comparison, the ESI suggests, may be with eastern European countries in the 1970s. As described by Timothy Garton Ash, they were like a frozen lake: unmoving on top, but full of activity beneath the surface.

For now, President Aliev and his cronies derive too many benefits to enact the kind of radical reform the country needs. But they cannot carry on like this forever.