AFTER MORE than three months, an American citizen held in U.S. custody in Iraq will finally see a lawyer. The man, whom the Pentagon believes to be an Islamic State fighter, has waited in military detention without outside contact beyond visits from the International Committee of the Red Cross. As a federal judge has now recognized, it is well past time that he be allowed to exercise his constitutional right to contest his detention in court.

Many of the facts of the man's case remain in the dark — including his name. According to reports, Syrian rebel forces captured him around Sept. 12 and delivered him to the U.S. military. He has remained in its custody since. Detaining him indefinitely would risk a potentially damaging court battle over the government's legal authority to use force against the Islamic State, but prosecutors fear they lack the evidence to convict him in U.S. criminal court. Officials are now considering whether to transfer him to Saudi Arabia, where he also holds citizenship. There's precedent to suggest the man might have to give up his status as an American citizen as part of the bargain: During a similar transfer in 2004, the government required Saudi American detainee Yaser Hamdi to relinquish his U.S. citizenship.

Throughout this process, the man has yet to meet with a lawyer. He requested legal counsel amid criminal interrogation and agreed when the government told him he would have to wait. But it's unclear whether he knew of his right to seek a lawyer in context of the constitutional guarantee of habeas corpus — his ability as a U.S. citizen to challenge the grounds of his detention before a judge. And when the American Civil Liberties Union stepped in from afar to litigate on the detainee's behalf, the Justice Department argued that the organization couldn't represent him without his or his family's consent. As the ACLU argued, this disturbing principle would allow the government to subvert the right to habeas corpus by simply keeping a detainee incommunicado and unidentified.

Judge Tanya Chutkan of the U.S. District Court for the District of Columbia dismissed this reasoning, holding that the government must grant the ACLU unmonitored access to meet with the detainee and must refrain from transferring him out of U.S. custody. Her ruling gives the Justice Department the option of appealing to block the ACLU's meeting. It should not do so. After three months, there is no good reason to keep this man from speaking with a lawyer.

The government may yet seek to transfer the detainee to Saudi Arabia. If the man gives up his citizenship before he meets with a lawyer, the transfer could raise murky legal questions. What's clear, however, is that the detainee has a right to counsel if he remains in the Pentagon's custody. To be sure, courts have found that detainees captured in wartime might not be able to exercise habeas corpus right away. But as Ms. Chutkan recognized, that doesn't mean the government can put off a constitutional right for more than three months with no justification.