BAGHDAD — The U.S. will hand over to Iraqi authorities nearly 50 Islamic State members who were transferred from Syria in recent days, two Iraqi intelligence officials said Thursday.

The officials said the IS members were expected to be handed over by Friday. They spoke on condition of anonymity because they were not authorized to brief the media.

The move comes after Turkey began a military offensive into northern Syria against U.S.-backed Kurdish-led fighters of the Syrian Democratic Forces who are holding more than 10,000 IS members. Those include some 2,000 foreigners, including about 800 Europeans.

It wasn’t immediately clear why the 50 IS fighters would be transferred to Iraq, but the group’s self-declared caliphate once sprawled across a large part of both Iraq and Syria. Since the IS was defeated earlier this year, Iraq has held IS captives in secure prisons and tried IS militants in court, including some French foreign nationals.

Before the Turkish assault began, there were already fears that Kurdish-led forces could divert forces from guarding IS prisoners or might not be able to secure them at a time when IS leader Abu Bakr al-Baghdadi made a point of calling on followers to free captured fighters. There are over two dozen detention facilities in northeastern Syria.

After the Turkish offensive began, concerns that some facilities may be struck in the fighting or abandoned by guards heightened fears the prisoners would not remain secured.

President Donald Trump said Wednesday that some of the “most dangerous” IS members had been moved, but he provided no details. Trump said before the assault began that Turkey would be responsible for all IS fighters in the area, though it wasn’t clear how that would be implemented.

U.S. officials said Wednesday that two British militants believed to be part of an IS group that beheaded hostages and was known as “The Beatles” were moved out of a detention center in Syria and taken into U.S. custody. It wasn’t clear whether they were among the 50 prisoners the Iraqi intelligence officials said were being transferred to Iraq.

The two men, El Shafee Elsheikh and Alexanda Amon Kotey, along with other British jihadis, allegedly made up the IS cell nicknamed “The Beatles” by surviving captives because of their English accents.

Attorney General William Barr approached Trump in recent weeks and said the government needed to make extracting “The Beatles” from the Syrian detention center a priority for the U.S. military, an administration official told The Associated Press. The president then put a plan in place to ensure the extraction, the official said.

Barr wants to bring the two men back to the U.S. to face prosecution, the official said. The official spoke on condition of anonymity to discuss private conversations.

In 2014 and 2015, the militants held more than 20 Western hostages in Syria and tortured many of them. The group beheaded seven American, British and Japanese journalists and aid workers and a group of Syrian soldiers, boasting of the butchery in videos released to the world.

Among the journalists they killed was American James Foley, who was first, followed by fellow Americans Steven Sotloff and Peter Kassig, British aid workers David Haines and Alan Henning and Japanese journalists Haruna Yukawa and Kenji Goto. The beheadings, often carried out on camera, horrified the world soon after IS took over much of Iraq and Syria in 2014.

The two British men were captured in January last year in eastern Syria by the Kurdish forces amid the collapse of IS. Their detention set off a debate in the U.S. and Europe over how to prosecute their citizens who joined IS.