Pentagon officials are "saddened" by the first American death in the ground fight against ISIS in Iraq, press secretary Peter Cook told reporters Thursday.

The U.S. Army Special Operator was killed in a rescue mission that freed as many as 70 ISIS hostages, defense officials said.

A senior U.S. defense official said the service member was shot in a gunfight. The Pentagon said he died after receiving medical care, and no other Americans were hurt.

The Arab hostages were freed from an ISIS prison in northern Iraq near Hawijah. "People were chained to walls," one well-placed military source told Fox News.

"A mass atrocity was averted," a senior U.S. defense source added. According to the Pentagon, rescuers "deliberately planned" the operation, and moved in when it was apparent that ISIS hostage takers were planning to kill the hostages.

When asked if the mission violated President Obama's vow not to put boots on the ground in Iraq, Cook said U.S. forces can "protect against the loss of innocent life" in their support role. He said Defense Secretary Ash Carter approved the mission, and the White House was aware.

The senior defense official said the U.S. carried out airstrikes before and after the operation, destroying the prison afterwards.

Officials said dozens of Kurdish Special Operations forces known as Peshmerga led the operation alongside dozens of U.S. Special Operations forces and five U.S. Special Operations helicopters. Four Peshmerga soldiers were reported wounded.

The senior defense official also said the U.S. provided "enabling support," including transportation, intelligence and advice. The mission was launched from Irbil, according to that official, who said no Westerners were rescued.

Cook said more than 20 members of the Iraqi Security Forces were freed.

One military source added that many hostages were from the Iraqi Army, and some were police. Some of those rescued were part of the "Sunni Awakening," the fight against Al Qaeda that saw Sunnis alongside U.S. forces almost a decade ago. 

Fox News is told U.S. forces killed 10 ISIS hostage takers during the overnight raid. The Pentagon said Iraqi forces detained five ISIS "terrorists."

Fox News' Jennifer Griffin and Lucas Tomlinson contributed to this report.