ALGIERS (Reuters) - Less than a year ago, Algeria was ready for a legal battle with French oil giant Total; it looked like business as usual for a country known for bureaucracy, tough contracts and often testy relations with foreign energy groups.
Yet, within months Total had dropped its action with international arbitrators, and signed a new gas deal with state energy conglomerate Sonatrach on improved terms.
When the dispute came to light in July, Sonatrach - the engine of Algeria's energy-based economy and state finances - had promised to defend the case vigorously, and portrayed Total as a minor player in the OPEC member country.
But something has changed. Last month the two sides reached a settlement over Total's complaint that Algeria changed profit-sharing terms on oil and gas contracts in the mid-2000s. That allowed a new deal for a delayed gas project with Total in the Sahara desert, which lies at the heart of Algeria's plans to expand energy exports to Europe.
This is just one signal of how three years into low world oil prices, Algeria is showing a new urgency and flexibility as its depleted energy earnings and competition in its European market test government nerves - and the state budget, which relies on energy for 60 percent of its revenue.
No one talks of a dramatic shift. Change can be slow in Algeria, where leaders prize stability, the economy is mostly state-run and an old guard clings to ideas rooted in the one-party socialism that followed independence from France in 1962.
Algeria's need to boost energy earnings is not quite as pressing as for some oil exporters. It has a big budget deficit but its foreign currency reserves, while sharply lower, remain at around $100 billion and the state has little debt.
Nevertheless, Energy Minister Nouredine Bouterfa has hinted at improved terms for foreign investors in contacts with the European Union, which is seeking strategic alternatives to Russian gas due to strained relations with Moscow.
During a visit to Brussels last month, Bouterfa said Algeria was holding talks with energy firms "to shed light on their understanding of our laws, including their apprehensions with regard to taxes and to bring the necessary corrections".
The object was to "boost the development of our partnership and make our country more attractive", he said in a statement, without giving details.
Sonatrach is becoming more agile with partners. "There is flexibility you didn't see five years ago," said one industry source. "It's not a seismic shift, but you see rhetoric and a posture of 'We are not the old Sonatrach'."
A Sonatrach press official did not immediately respond to Reuters questions about dealings with foreign partners and details on the Total agreement.
Gas production is already rising. Sonatrach forecasts output at 141 billion cubic metres (bcm) this year, up from 132.2 bcm in 2016. Exports will hit 57 bcm this year, from 54 bcm in 2016.
Algiers is No. 3 gas supplier to Europe, but EU officials have doubted its long-term reliability due to past stagnant output and contracts which foreign operators complain left them with little profit, even when prices were high. Soaring domestic gas demand for power generation, partly due to a growing population, has also eaten into supplies available for export.
Sonatrach has had internal problems, too, and is onto its sixth boss in seven years. Following corruption scandals, officials have been wary of making decisions for fear of landing themselves in trouble. Some foreign ventures were left in limbo.
Many of the problems remain but the Algerian energy leadership has begun to see it has misjudged strategy, industry sources say. In particular, it underestimated how long global oil prices would remain low and the depressing effect of new production from U.S. shale deposits.
"There was an error of judgment, or let's say a mismanagement of the reservoir," one top Sonatrach executive told Reuters.
The new Total deal means the Timimoun field will be operated under 2013 amendments to the hydrocarbons law, which give more incentives than the previous contract offered, another Sonatrach source said. Total did not respond to a request for details, but has said it has "new contractual framework" for Timimoun.
"It's a very positive sign," said Geoff Porter at North Africa Risk Consulting. "There is a sense right now in the Algerian oil and gas sector that they have to make up for lost time. This urgency to get exploration and production back up to speed is in part what led to the changes in the Sonatrach leadership."
History weighs heavily on reform in Algeria. An 1980s oil slump forced IMF-backed austerity and played a role in the rise of hardline Islamists that led to a decade of civil war.
The experience left its leaders cautious. Later oil dips prompted plans for privatisations and energy law reform, only for these to fizzle out or be reversed once prices recovered.
Overshadowing any reform talk is an eventual transition from President Abdelaziz Bouteflika - in office for nearly two decades but who has rarely appeared in public since suffering a stroke in 2013 - and the power of resource nationalism.
In 2005, his reform-minded then energy minister Chakib Khelil pushed though an investor-friendly oil law, but the presidency effectively reversed it the following year, decreeing measures that included a windfall energy tax.
Scandals forced Khelil into exile but he was never charged with any crime and returned home this year. While he holds no official post, some observers see his hand in the apparent shift in course.
When oil was over $100 a barrel, development of gas output around the giant Hassi Messaoud and Hassi Berkine fields, which have significant potential, was abandoned. Instead, Algeria favoured unexplored regions in a push for a major find.
Shifting the focus away from swift production increases to unexplored areas like Tindouf near the Western Sahara did not pay off. "We lost $1 billion when we found nothing after digging nine wells in the region of Tindouf in 2014," one Sonatrach source said. "We were too focused on exploration and not on immediate production."
Sonatrach has become more dexterous with foreign partners, moving to bilateral negotiations last year instead of drawn-out auctions. That gives it more room to renew contracts and lift short-term gas output.
"My sense is that the new oil minister is more pro-active and is likely to make things happen," one industry source said. "You see someone is trying to make deals."
Fields in southern Algeria are now expected to yield around 9 bcm of new gas output. This includes 1.6 bcm from Timimoun, where Total is involved, 4.5 bcm from the Toaut field run with Engie of France and 2.9 bcm from Reggane North with Spain's Repsol. The Isarene field with Petroceltic will come on stream later.
Time though is not on Algeria's side for longer-term output. Fitch Group's BMI Research forecast last year gas production would rise 2.2 percent a year till 2020, but then level out.
Even future potential in shale output - Algeria has the world's third largest unconventional gas reserves - is on hold over political sensitivities, a lack of infrastructure and the need for a huge injection of foreign cash and technology.
Development will in any case be slow. "Unconventionals are the one resource they have and that is going to take 10 years," said one industry source.
Sonatrach is again in flux, replacing its chief executive with Abdelmoumen Ould Kadour in March. "Changing Sonatrach's top management so often is definitely not the best signal," said one source at the company.
But Porter noted that Bouterfa and Ould Kabour are both close associates of Khelil, a U.S.-educated former World Bank technocrat and OPEC president seen as a reforming influence.
"Now Khelil has his two allies at the helm of Algeria's energy sector," said Porter. "He will be able to exert his influence over policy, yet remain out of the limelight."
editing by David Stamp