One day after Islamic militants invaded an Algerian gas field and seized dozens of Western workers, there are fears that several of the foreign hostages might be dead—potentially escalating the military intervention in neighboring Mali into a full-scale regional conflict. For months, a parade of Western diplomats and politicians, including Secretary of State Hillary Clinton and French President François Hollande, have visited Mali’s big, richer neighbor—Algeria—to try to persuade the government to deploy its crack military forces against al-Qaeda fighters in control of northern Mali. For months Algeria rebuffed their pleas, despite its long military and intelligence ties with the U.S., reluctant to be dragged into a Western-led fight and risk igniting a bloody conflict at home.

But the fight has come to Algeria. Reports suggest that at least 24 foreign hostages were killed when Algerian soldiers mounted a raid on the natural-gas compound in the south-east of the country to free them Thursday; the Algerian state news agency says some 600 hostages have been freed by the operation. As news filters in from the massive, remote facility, fears now grow that the week-old French military intervention in northern Mali is spinning into a broader war, drawing in one of the world’s biggest oil and gas producers—precisely the situation Algeria was determined to avoid. “No matter which way Algeria deals with this, this will have a heavy consequence,” says Jean-Pierre Filiu, a specialist on the country at the Institute of Political Studies in Paris, who accompanied President Hollande last month to the capital Algiers where the French leader met President Abdelaziz Bouteflika. Even then, the assumption was that despite jihadi networks in control across its southern border, Algeria would likely remain relatively secure. “Never, ever, did the jihadis touch the oil and gas facilities of Algeria,” Filiu says. “This is totally unprecedented.”

Unprecedented, but apparently simple. Before dawn on Wednesday, about 20 armed militants invaded the living quarters at the Ain Anemas natural-gas field, about 1,000 miles from Algiers, and seized 41 foreign hostages, among them seven Americans, as well as Britons, Japanese, French, Norwegian and Irish citizens. An unknown number of Algerian workers were also kidnapped. The militant group, calling itself the “Masked Brigade,” is led by an Algerian-born jihadist Mokhtar Belmokhtar, who is believed to have masterminded several kidnappings, and to have ties to the region’s main terror franchise, al-Qaeda in the Islamic Maghreb. Filiu believes the group had probably driven from northern Mali, hundreds of miles across the Sahara—a sign of their stunning ability to operate in the remote desert. “They have a tremendous asset with the extreme mobility of their commandos,” he says. “They move at night with no headlights, at high speeds, totally undetected.”

Keeping those commandos away from its oil and gas wealth is critical for Algeria, since that comprises some 60% of its revenues and more than 95% of its exports. Ain Anemas, run jointly with BP and Norway’s Statoil, pumps about one-sixth of the natural gas produced by Algeria, which is Europe’s third-biggest gas supplier, and a key supplier to the U.S. Algeria also has about 12.2 billion barrels of proven oil reserves, the third biggest reserves in Africa after Libya and Nigeria, according to the U.S. Department of Energy.

The well-armed Algerian forces had surrounded the compound since Wednesday’s attack, firing sporadically, while the government attempts to defuse the crisis politically, conferring with Tuareg tribesmen who have links to al-Qaeda groups, and consulting U.S. and French officials through Wednesday night, according to the Associated Press, citing an unnamed Algerian security official. From inside the compound, hostages described a terrifying ordeal, saying captors fitted some of them with explosives. “The situation is deteriorating,” an Irish hostage told Al Jazeera by phone. “We are worried because of the continuation of the firing.”

The crisis is deeply worrying for Algeria, too. As darkness fell on Thursday night, there were confused reports about the state of the hostages, with one stating that only a handful of them were alive.

With 4,500 miles of borders with Niger, Libya, Tunisia, Morocco and Mali, the country is huge, about the size of Western Europe, and straddles about half of the Sahara Desert, where al-Qaeda in the Islamic Maghreb, or AQIM, has built up an impressive arsenal, using a war chest of tens of millions of euros amassed in part from hostage-ransom payments by European governments. Alarmed at the jihadist groups’ growing wealth, Algerian diplomats led an effort in 2010 to get the U.N. to ban governments from paying ransoms, which they claimed were thwarting counter-terrorist efforts. At that time, the Algerian president’s advisor, Kamel Rezag Bara, told me, “If you think about the fact that you can buy anyone in this region—anyone—for €5,000, you can see the problem.”

The problem for Algeria and its neighbors has worsened since then, partly thanks to the mountain of weaponry that poured out of Libya after Muammar Gaddafi’s downfall in October, 2011. Since then, Algerian officials have sidestepped confrontation with jihadists, instead opting to push them deeper into the southern Sahara areas, away from the country’s critical energy infrastructure, and across its borders. At the same time, Algeria maintained contact with Ansar Dine, one of the more prominent Islamist groups running roughshod over northern Mali, and Algeria’s critics say it has too readily tried to avoid conflict with some of the more criminal militias in the region.

At stake for Algeria’s government is its ability to keep the country at peace, something on which Bouteflika has staked his presidency. Since independence from France, Algeria has been ruled by the same revolutionary—now authoritarian—political party. Bouteflika came to power at the end of a brutal civil war with Islamist forces, which killed about 150,000 Algerians between 1991 and 1999. And until now, the government’s tactic appeared to work: By avoiding all-out battle against jihadists, the militants avoided attacking Algeria’s energy facilities.

But all that changed when France began bombing northern Mali last Friday. Algeria granted French fighter jets overflight permission. It also sealed its southern border with northern Mali, threatening to starve Northern Mali’s jihadists of fuel—essential in their fight against French and African troops—since most of the area’s gas stations are located in southern Algeria. “These columns of vehicles require a lot of fuel,” says François Heisbourg, an expert on the region, who is chairman of the International Institute of Strategic Studies in London. “It was perceived as a sign that Algeria would not let these guys do whatever they were going to do.”