Federal Judge Nancy Edmunds said Thursday she has no authority to intervene in a matter that's up to prison officials. Doctors say Najib Shemami has cancer and less than four months to live.
Officials at a federal prison in North Carolina say Shemami might commit more crimes if released.
The warden has declined to approve his release.
The 62-year-old Shemami has served about a year of a 46-month sentence for passing sensitive information to Iraq. He informed Iraq about military movements in Turkey before the 2003 U.S.-led invasion that overthrew Saddam.
Shemami's relatives say he would live with them in Oakland Township if released.