Algeria's military on Thursday launched a deadly attack against Islamist militants holding Western hostages in a Sahara desert gas complex, allowing some captives to flee.
The helicopter strikes allowed some 200 Algerian workers and several foreigners to flee and killed several of the militants, according to the hostage-takers, witnesses and media reports.
The militants claimed that 35 hostages and 15 captors were killed, speaking to Mauritania's ANI news agency - but this could not be confirmed.
Ireland said one of its nationals had escaped and there were reports that four hostages from Britain, France and Kenya were freed. It was unclear how many people were injured or killed.
The "Blood Signatories" brigade, affiliated to al-Qaeda in the Islamic Maghreb (AQIM), earlier claimed to be holding 41 hostages.
The militants told ANI they were still holding two Americans, three Belgians, a Japanese and a Briton. The original group also included several Norwegians, a Romanian and an Austrian.
The militants have demanded an end to France's military operation against Islamist rebels in neighbouring Mali and said they wanted to also punish Algeria for allowing French warplanes to overfly the country, ANI said.
Algerian radio said the military had launched Thursday's attack after the hostage-takers attempted to flee with a number of captives.
"Two all-terrain vehicles which attempted to flee with an undetermined number of people aboard were targeted by ANP (Algerian national army) forces," the radio said.
"The operation to free the hostages, which was continuing in the early afternoon, caused several victims," the report added, without giving details.
Witnesses among the Algerian workers told the Algerie 1 news website they had seen "several" dead and wounded hostage-takers as well as an unspecified number of "injured" foreign hostages.
Algeria's APS official news agency said that four foreign hostages were freed during the intervention: two British nationals, one French and one Kenyan.
The Irish government said a 36-year-old Irishman had been freed and had told his family that he was "safe and well."
Before the raid, Ennahar television reported that 15 foreigners, including a French couple, had escaped.
If that report were confirmed it would discredit the hostage-takers' claims of 35 victims among the hostages.
The group is one of three Islamists groups targeted by the French military in Mali.
The hostage-takers - who claimed to be led by Mokhtar Belmokhtar, a one-eyed terrorist believed to be behind several kidnappings in recent years - had threatened to kill the hostages if the army
intervened.
"We will kill all the hostages if the Algerian army tries to free them by force," a spokesman had told ANI, demanding to negotiate.
Two people, one British and one Algerian, were killed and six people were injured when the militants launched the attack on the In Amenas workers' compound early Wednesday.
British Foreign Secretary William Hague condemned the Briton's "cold-blooded murder."
British, Irish and Japanese hostages who spoke to broadcaster Al Jazeera by telephone early Thursday had appealed to the army to hold its fire to allow negotiations to begin.
A 52-year-old French hostage, who spoke to Sud Ouest newspaper by telephone earlier said they were being "treated well."
President Francois Hollande said Thursday he had "every confidence in Algerian authorities" to resolve the crisis.
Algeria, which has a long history of combating Islamist terrorism, has ruled out negotiating with the group.
Interior Minister Dahou Ould Kablia told local television on Wednesday that the authorities "will not answer the terrorists' demands."
In Amenas gas field, one of Algeria's biggest, is operated by a consortium comprising Britain's BP, Norway's Statoil and Algerian state company Sonatrach. Statoil said Thursday that production at the facility had been shut down.