ALGIERS, Algeria — In a bloody finale, Algerian special forces stormed a natural gas complex in the Sahara desert on Saturday to end a standoff with Islamist extremists that left at least 23 hostages dead and killed all 32 militants involved, the Algerian government said.

With few details emerging from the remote site in eastern Algeria, it was unclear whether anyone was rescued in the final operation, but the number of hostages killed on Saturday — seven — was how many the militants had said that morning they still had. The government described the toll as provisional and some foreigners remained unaccounted for.

The siege at Ain Amenas transfixed the world after radical Islamists linked to al-Qaida stormed the complex, which contained hundreds of plant workers from all over the world, then held them hostage surrounded by the Algerian military and its attack helicopters for four tense days that were punctuated with gun battles and dramatic tales of escape.

Algeria's response to the crisis was typical of its history in confronting terrorists, favoring military action over negotiation, which caused an international outcry from countries worried about their citizens. Algerian military forces twice assaulted the two areas where the hostages were being held with minimal apparent mediation — first on Thursday, then on Saturday.

"To avoid a bloody turn of events in response to the extreme danger of the situation, the army's special forces launched an intervention with efficiency and professionalism to neutralize the terrorist groups that were first trying to flee with the hostages and then blow up the gas facilities," Algeria's Interior Ministry said in a statement about the standoff.

Immediately after the assault, French President Francois Hollande gave his backing to Algeria's tough tactics, saying they were "the most adapted response to the crisis."

"There could be no negotiations" with terrorists, the French media quoted him as saying in the central French city of Tulle.

Hollande said the hostages were "shamefully murdered" by their captors, and he linked the event to France's military operation against al-Qaida-backed rebels in neighboring Mali. "If there was any need to justify our action against terrorism, we would have here, again, an additional argument," he said.

In New York, the U.N. Security Council issued a statement condemning the militants' terrorist attack and said all perpetrators, organizers, financiers and sponsors of such "reprehensible acts" must be brought to justice.

In the final assault, the remaining band of militants killed the hostages before 11 of them were in turn cut down by the special forces, Algeria's state news agency said. The military launched its Saturday assault to prevent a fire started by the extremists from engulfing the complex and blowing it up, the report added.

A total of 685 Algerian and 107 foreigner workers were freed over the course of the four-day standoff, the ministry statement said, adding that the group of militants that attacked the remote Saharan natural gas complex consisted of 32 men of various nationalities, including three Algerians and explosives experts.

The military also said it confiscated heavy machine guns, rocket launchers, missiles and grenades attached to suicide belts.

Sonatrach, the Algerian state oil company running the Ain Amenas site along with BP and Norway's Statoil, said the entire refinery had been mined with explosives, and that the process of clearing it out is now under way.