Updated

A Guantanamo prisoner from Algeria lost a last-minute legal maneuver Wednesday to go home before President-elect Donald Trump takes office.

U.S. District Judge Rosemary Collyer in Washington declined to intervene in a Defense Department decision not to repatriate Sufyian Barhoumi in the final days of the Obama administration.

A government review board approved the repatriation of Barhoumi in August. But Defense Secretary Ash Carter did not give final approval and issue a 30-day notice to Congress of his impending release as required by law.

In an emergency court petition, Barhoumi's attorney, Shane Kadidal, said he feared that Barhoumi and a Moroccan prisoner in a similar situation might not make it out under Trump, who has said he wants to continue using the detention center on the U.S. base in Cuba.

Lawyers for the men argue that there is no longer any justification for holding them given the board's decision, which found that both countries could adequately ensure neither man posed a threat in the future. Kadidal said he had expected Barhoumi to be released and the prisoner's family had already begun making preparations for his return, including by buying him a car and a small restaurant for him to run.

More on this...

"We had no indication that there was a problem until suddenly the deadline passed," he said.

The Justice Department opposed the request and said Carter rejected the release of Barhoumi on Jan. 12 "based on a variety of substantive concerns, shared by multiple agencies," without going into detail.

Collyer said the defense secretary has the authority not to release the 43-year-old Algerian at this time and denied the request. Kadidal, of the New York-based Center for Constitutional Rights, said he probably would not appeal given the timing, two days before the inauguration.

U.S. District Judge Colleen Kollar-Kotelly is considering a similar motion filed on behalf of the Moroccan prisoner, Abdullatif Nasser. The 51-year-old was cleared for repatriation by the review board in July. But the Department of Justice said his country did not provide some needed information until Dec. 28, which was too late for the Defense Department to give its required 30-day notice to Congress.

There are 45 prisoners at Guantanamo. They include nine cleared for release such as Nasser and Barhoumi. Several may still make it out before Jan. 20.

Shelby Sullivan-Bennis, an attorney for the Moroccan, said she still hopes her client will be among those released. "Hoping that common sense will prevail."