Europe's attempts to wean itself off Russian gas have given Algeria a shot in the arm.
Flush with energy revenues after Russia's invasion of Ukraine sent demand for its oil and gas soaring, authorities are spending more on social benefits and taking a more assertive stance abroad, pivoting from years of declining wealth and the political upheaval of a mass protest movement.
President Abdulmadjid Tebboune has announced expected increases to public sector wages, pensions and unemployment payments, returning to a model of generous social spending to which Algerians have long been accustomed.
The government has also taken a bolder stance towards European countries made more reliant on North African gas by the Ukraine war, such as Spain, responding to more active efforts by its main rival Morocco to gain their support on regional issues.
"The government is no longer under social and political pressure as was the case in 2019 and 2020," said an adviser working for the government.
"Hirak (the mass protest movement) is over. COVID-19 is under control and revenues are up."
The contrast with the recent past is stark.
From 2019-20 weekly mass protests shook the establishment, leading the army to force out veteran president Abdelaziz Bouteflika and other prominent figures.
A sharp decline in energy revenues and foreign currency reserves after oil prices plunged in 2014 had meanwhile forced sharp cuts to public spending that risked sparking further unrest.
Compounding concerns, the energy sector was failing, with minimal investment in oil and gas fields, lower export volumes and a flood of talent from state company Sonatrach, which in recent decades has averaged a new head every 20 months.
The surge in global prices for oil and gas following Russia's Feb. 24 invasion of Ukraine has helped stabilise the situation, filling state coffers and boosting confidence.
Analysts nevertheless say Algeria has little choice but to press on with potentially difficult reforms to insulate its economy from future energy market slumps.
Tebboune has promised to do so and has moved to boost trade with some African countries, but government efforts to open up one of the world's most closed economies have so far made little headway.
"Yes, revenues are up. But the economy still needs reforms to perform," said a former government minister.
CLOUT
Europe's energy crisis has not only raised prices, it has created more demand for gas supplies that will be unaffected by the Ukraine war, giving Algeria more clout.
Algerian supplies account for more than a quarter of gas demand in each of Spain and Italy and Sonatrach is the third-biggest exporter to Europe after Russia and Norway.
Sonatrach has said oil and gas earnings this year will reach $50 billion, compared to $34 billion last year and $20 billion in 2020, while official figures forecast non-oil exports to top $7 billion - a record.
Rules to encourage foreign involvement in Algeria's energy sector have helped increase investment and develop new projects.
In June, Sonatrach announced a new discovery at its biggest gas field, Hassi Rmel, adding 100 billion-340 billion cubic meters of gas condensate to reserves with expected additional output of 10 million cubic meters of gas a day from November.
A greatly expanded gas supply deal with Italy may meanwhile serve as a reminder to European states of the benefits of friendship with Algeria.
Spain, which relies on Algerian gas, this year switched to support Morocco on Western Sahara, a territory that Rabat sees as its own but where Algeria backs an independence movement.
Algeria withdrew its ambassador as a result and cut some trade. Though it has made clear it will honour the terms of its gas supply contract, it seems in little mood to be generous in approaching scheduled pricing talks.
"No doubt the gas card has served Algeria. It is courted, and not a day goes by without European countries contacting the authorities to discuss possible sales," said a retired Algerian energy official.
REVENUE
Yet despite the additional diplomatic sway it has gained from higher energy demand, Algeria's focus is likely to stay on maximising revenue from increased prices to soothe a population that had started growing restive.
"I am happy to get 13,000 dinars a month," said Mouna Belgacem, a 24-year-old graduate who is among about a million Algerians receiving unemployment benefit after spending three years seeking a job.
Speaking this month, Tebboune said: "As long as there are additional revenues this year, I commit to increasing wages and unemployment benefit", adding that Algeria was struggling to "restore dignity".
State benefits and wages are expected to rise next year.
Whether the easier funding of a state-heavy economic model on which Algeria has relied for decades will hinder reforms aimed at boosting employment and wealth through the private sector is not clear.
Long-term, the authorities must know that economic frustrations could stir public unrest despite an uncompromising security approach.
The leaders of the "Hirak" mass protest movement have faced repeated arrest since demonstrations tailed off during the pandemic, without achieving their ultimate goals of a purge of the ruling elite and the army quitting politics.
Samir Belarbi, a prominent Hirak figure, has been arrested twice and served time in prison for "infringing territorial integrity" and "disseminating or holding publications harming national interests".
He says the movement will continue.
"We must now find new ways to fight peacefully for free justice, free press, accountable government and transparency," he said.
(Reporting by Lamine Chikhi, Editing by Angus McDowall and Catherine Evans)