President Donald Trump’s administration held secret talks with Iran on deporting Iranians even as the war there dragged on, court documents obtained by The Associated Press show.

The documents, unsealed Thursday, show the administration as recently as mid-October said it had plans to deport Iranians through an unnamed third country, although it was unclear when it intended to do so. The contacts with Iranian officials focused on submitting travel documents and figuring out “possible avenues for removal.”

The judge in the case ordered the government to give the court 24 hours’ notice of any finalized plans to deport Iranians to Iran or to any other country, and five days’ written notice before any such deportation is carried out.

At an Oct. 15 hearing, U.S. District Judge Ana Reyes questioned the government’s intentions, saying that returning people to the region would mean, “at a minimum, a serious threat of certain death.” Justice Department attorney Dimitar Georgiev-Remmel answered that the government was “executing lawful orders of removal.”

A legal group representing Iranians held by Immigration and Customs Enforcement said at least a dozen Iranian detainees had been notified over the past week that they were being deported to Iran, with some told it could be as soon as Sunday. The Iranian American Legal Defense Fund said the detainees were contacted by the Iranian Interests Section, an Iranian representative office in the Pakistani Embassy in Washington, about an upcoming deportation flight to Iran through Pakistan. None had received written notice from U.S. immigration authorities.

The disclosures emerged in Iranian American Legal Defense Fund v. Rubio, a lawsuit filed July 7 in the U.S. District Court for the District of Columbia alleging the administration’s immigration agencies have been sharing confidential information about Iranian asylum seekers with the Iranian government, violating national immigration regulations and endangering countless Iranians. The Department of Homeland Security has denied sharing asylum application records with Iran.

Earlier court filings and emails, made public in August, showed the administration held talks with Iran on deportations that took place last year and shortly before the war, and that more than 100 Iranians were flown back to Iran on three flights in September and December 2025 and January 2026. The war began with U.S. and Israeli strikes on Iran on Feb. 28 and is now in its ninth month.