The Algerian government on Thursday staged a high-stakes military assault against Islamist militants to free scores of hostages, including Americans, at an international gas complex in the Sahara, with official accounts suggesting a tragedy had unfolded in the desert.

Algeria’s attack against the militants sparked a torrent of complaints from countries representing the hostages. The United States, which had urged caution, was not notified before Algerian forces conducted the raid, an Obama administration official said. British Prime Minister David Cameron expressed dismay through a spokesman that he wasn’t consulted. Japanese Prime Minister Shinzo Abe had urged Algeria to halt the operation.

Details from the remote outpost near Algeria’s border with Libya remained sketchy, but the conflicting accounts nevertheless indicated a potentially significant number of casualties among hostages and captors.

Algerian Communications Minister Mohamed Said Oubelaid told state media late Thursday that combat operations had “ended.” But efforts to free the hostages were continuing, he said, adding that many had been liberated but that some had died. Private Algerian media outlets reported that militants who escaped the attack were still holding some hostages, with government forces in pursuit.

“This is a very dangerous, very uncertain and very fluid situation, and I think we have to prepare ourselves for the possibility of bad news ahead,” Cameron said Thursday, after confirming the death of one Briton.

In an interview Thursday with ABC News, Defense Secretary Leon E. Panetta said that “about 100 people” were at the complex when the attack occurred but that it was unclear how many were taken hostage. He said initial reports were that the hostages included “somewhere in the vicinity” of seven or eight Americans. “Right now, we just really don’t know,” he said.

Panetta’s comments appeared to raise doubts about reports by the official Algerian Press Service that quoted local sources as saying that four foreign hostages and nearly 600 Algerian workers were “freed” Thursday.

The events at the plant evoked memories of the North African nation’s bloody civil war against Islamist extremists in the 1990s and underscored the rapidly escalating tensions in a region where French troops have come to the aid of the fragile government in neighboring Mali as it seeks to block the advance of emboldened militants.

Spokesmen for the hostage-takers have said that their siege was a response to the French operation in Mali. Experts, however, said that the sophistication of the attack suggested that it may have been planned long before France intervened last week and that the motive may have been a show of force against an old adversary — the Algerian military.

The ability of militants to mount the most daring attack on Algerian soil in years rattled observers, who had considered the country’s energy fields — which supply Western Europe with 20 percent of its natural gas — as beyond the reach of radical groups. Should the number of causalities prove to be as high as some reports indicated, it could stain the image of the Algerian military domestically and raise questions about the type of counsel and offers of aid made to Algiers by U.S. and European governments.

Some U.S. officials suggested that Algeria’s refusal to coordinate with allies was a reflection of local sensitivities, with Algerian officials fiercely protective of their national sovereignty. The former French colony has strengthened its ties with the United States in recent years, particularly on counterterrorism issues. But its relations with the United States and Europe also have been strained at times, with the Algerian government resistant to allowing foreign military activity within its territory. When the United States sought overflight permission for surveillance flights en route to Mali, Algeria agreed to the flights only on a case-by-case basis, according to U.S. officials.

The Obama administration official, who spoke on the condition of anonymity to describe sensitive diplomacy, said Algeria and the United States had conferred about the hostage-taking before the raid but not about the military operation.

A map locating In Amenas, Algeria

“Before the raid began, we urged the Algerians to be cautious and strongly encouraged them to make the safety of the hostages their top priority,” the official said.

Rep. Mike Rogers (R-Mich.), chairman of the House intelligence committee, said the militant attack was a “brazen, large-scale raid” that went far beyond the scope of the kidnapping operations that have become routine for al-Qaeda’s affiliate in North Africa.

“Everything that I’ve seen . . . leads me to believe that this was a preplanned event,” Rogers said. The militants may have begun by scouting for kidnapping targets, he said, but “once the French intervention happened, they said, ‘We want to go for something big.’ ”

A high-stakes operation

Algerian forces launched their rescue operation early Thursday, a day after militants took dozens of hostages at the sprawling Tiguentourine plant, jointly run by BP, Norway’s Statoil and the Algerian state energy company, Sonatrach, near the border with Libya and about 25 miles southwest of the town of In Amenas.

BP said it had begun pulling nonessential personnel out of the country for what it described as a “temporary” period. Analysts said the attack could test the mettle of foreign oil companies operating there, with experts predicting that the Algerians would move to significantly beef up security at energy sites.

Speaking through Mauritania’s ANI news agency — considered sympathetic to the militants — a spokesman for the extremists said the Algerian government assault began after the captors attempted to spirit hostages out of the facility in trucks. Ensuing helicopter fire left 35 hostages and 15 captors dead, the spokesman told the agency. Neither Algerian officials nor Western governments have confirmed the toll.

The Mauritanian agency later said that in its final contact with the hostage-takers, the militant spokesman — speaking by telephone over explosions in the background — said the group was under attack from Algerian helicopters and ground forces. The Islamist group, which calls itself the Masked Brigade, threatened to execute the surviving hostages if the troops advanced any closer, ANI said. After those words, it said, the line went dead.

Irish authorities said their single national taken hostage, Stephen McFaul, had phoned his family after escaping. The BBC showed his young son, Dylan McFaul, close to tears as he described his reaction on hearing the news that his father was safe: “I couldn’t stop crying, I was all excited, hugging everyone. I just don’t know what to say.”

Pentagon officials traveling with Panetta in Europe said they were trying to sort out conflicting reports about what had happened at the gas complex, how many Americans may have been involved and what course of action U.S. military forces might take in response.

Pentagon spokesman George Little declined to comment on reports that a U.S. surveillance drone had been deployed to fly over the site.

Islamist movements

Although Algeria had in recent years succeeded in confining the extremists to relatively small bands of fighters in the mountains, the nation is known to have given birth to most of the hardened Islamist militants who over the past two decades have created well-armed North African movements.

The group that took over the gas plant is thought to be tied to Mokhtar Belmokhtar, 40, an Algerian militant who did combat in Afghanistan while still a teenager and returned two years later, having lost his left eye and earning the nickname “One Eye.”

Defeated by the Algerian army a decade later, Belmokhtar and most of his fellow guerrilla fighters scattered to the thinly populated mountains along the border with Mali and roamed the desertlike flatlands across northern Mali, Mauritania and Niger.

It was there that al-Qaeda in the Islamic Maghreb (AQIM) took shape, in the form of three divisions of fighters with separate leadership but a shared dedication to hostage-taking, smuggling and propagation of strict Islamic ways. Over the years, the Algerian-formed divisions began attracting recruits from other countries, such as Mali, Mauritania and even Pakistan.

Belmokhtar and his fellow guerrillas boosted his group’s weapons arsenal with supplies carted in from Libya after Moammar Gaddafi was booted from power in 2011 by rebels backed by Western air power.

“If anything, this attack may show that Algerians can’t protect their hydrocarbon facilities as had been assumed,” said Jon Marks, a North Africa expert at Chatham House, a London-based think tank. “This wasn’t some isolated pumping station. It was a big project that had been getting bigger, and this is going to be seen as an extreme embarrassment for the government.”

Joby Warrick, Anne Gearan and Greg Miller in Washington, Edward Cody in Paris, Said Chitour in Algiers and Eliza Mackintosh and Craig Whitlock in London contributed to this report.