WASHINGTON — The Trump administration must give lawyers with the American Civil Liberties Union 72 hours notice before transferring a United States citizen imprisoned in Iraq as an enemy combatant for more than four months, a federal judge has ruled.

The man, whose name has not been released, was captured by a Syrian militia in September and turned over to American forces as a suspected Islamic State fighter, raising a dilemma about what to do with him. He is said to have been born in the United States to visiting Saudi parents, making him an American citizen, but raised in Saudi Arabia, where he apparently also is a citizen.

After law enforcement officials concluded that they had insufficient courtroom-admissible evidence to bring criminal charges against the man, Trump administration officials in December decided to try to transfer him to Saudi custody, according to officials familiar with deliberations.

But the eight-page ruling late on Tuesday by the judge, Tanya Chutkan of the Federal District Court for the District of Columbia, ensures that if such a diplomatic deal is reached, the man could fight his transfer in court.