Pentagon says about 70 hostages saved from execution during raid on ISIL prison near Hawija, which left US soldier dead.

US special forces and Iraqi Kurdish Peshmerga forces have carried out a raid on an Islamic State of Iraq and the Levant (ISIL) group stronghold in Iraq and freed about 70 hostages facing execution, according to US defence officials.

In a statement published on Thursday, the Pentagon said one soldier had died during the raid in Hawija, which killed “a number of ISIL terrorists”.

“This operation was deliberately planned and launched after receiving information that the hostages faced imminent mass execution,” the statement read.

Pentagon spokesman Peter Cook said at least 20 of those rescued were members of the Iraqi security forces and that officials were reviewing the identities of the others freed, adding civilians were among the group.

“The US provided helicopter lift and accompanied Iraqi Peshmerga forces to the compound,” where ISIL held the hostages, Cook said.

The death of a US soldier is the first in combat in Iraq since the US campaign against ISIL began in 2014.

According to the office of Kurdish intelligence chief Masrour Barzani, 69 prisoners were rescued, six ISIL fighters detained and more than 20 killed.

REPORTER’S NOTEBOOK: The Iraqi Kurds and then came ISIL

Al Jazeera’s Rosiland Jordan, reporting from Washington DC, said there were suggestions the central government in Baghdad did not know the operation was taking place until “they started receiving phone calls from reporters”.

“We don’t know if there is a larger battle at hand to take Hawija from ISIL, which it has been holding for about a year and three months.

“This may have been a test run, or there is an idea that there was a mass execution looming is why the US provided support to Peshmerga, ” Jordan said.

ISIL seized large swathes of Iraq during an offensive in the summer of 2014 and with its military successes it has captured Iraqi and Kurdish regional troops and civilians.

The armed group has used its hostages to seek out ransom payments but has also carried out massacres against prisoners.

US counterterrorism and intelligence consultant Malcolm Nance told Al Jazeera that the mission had been a “resounding success”.

“All in all, this was a good mission. They went in to get 20 people and came out with 70,” Nance said, adding that a huge amount of planning would have gone into the rescue.

“Massive planning is needed for this kind of mission, especially on the intelligence side,” he said. “Hundreds of people offer input for this kinds of mission – and thousands offer support.