SALAHADDIN, Iraq — Muhammad Hassan Abdullah al-Jibouri had little hope that he would ever make it out of the Islamic State’s jail alive, and he had not even seen the sun in more than a month. Then, early last Thursday morning, he heard the helicopters overhead.

The 35-year-old police officer heard bursts of gunfire, and shouts in Kurdish and in English. Suddenly, the door to his cell was battered open.

“Who is there? Who is there?” a soldier yelled, first in Kurdish and then in Arabic.

“We are prisoners!” Mr. Jibouri’s cellmates yelled back.

Mr. Jibouri was one of 69 Arab prisoners of the Islamic State freed in a military raid near the northern Iraqi town of Hawija last week, the first in which American Special Operations forces were confirmed to have accompanied their Kurdish counterparts onto the battlefield.