BAMAKO, Mali — The four-day hostage crisis in the Sahara reached a bloody conclusion on Saturday as the Algerian Army carried out a final assault on the gas field taken over by Islamist militants, killing most of the remaining kidnappers and raising the total of hostages killed to at least 23, Algerian officials said.

Although the government declared an end to the militants’ siege, the authorities believed that a handful of jihadists were most likely hiding somewhere in the sprawling complex and said that troops were hunting for them.

The details of the desert standoff and the final battle for the plant remained murky on Saturday night — as did information about which hostages died and how — with even the White House suggesting that it was unclear what had happened. In a brief statement released early Saturday night the president said his administration would “remain in close touch with the government of Algeria to gain a fuller understanding of what took place.”

The British defense minister, Philip Hammond, called the loss of life “appalling and unacceptable” after reports that up to seven hostages were killed in the final hours of the hostage crisis, and he said that the leaders of the attack would be tracked down. The Algerian government said that 32 militants had been killed since Wednesday, although it cautioned that its casualty counts were provisional.