A Camp Justice sign marks the site of the U.S. military commissions court for war crimes in Guantanamo Bay, Cuba. (Brennan Linsley/AFP/Getty Images)

The nation’s second-highest court on Thursday upheld the ­conviction of a Guantanamo Bay ­detainee, siding with the ­government in a case that tested the power of the military tribunal system.

In a 6-to-3 ruling, the U.S. Court of Appeals for the D.C. Circuit upheld the conspiracy conviction of Ali Hamza al-Bahlul, a former media secretary to Osama bin Laden.

Four judges agreed that military commissions in general have the authority to handle the domestic-law charge of conspiracy that is not an international war crime. There was, however, no clear majority with judges filing four separate concurring opinions.

The D.C. Circuit has been grappling with questions about the reach of military commissions for years. The case was argued last December before a full panel of 10 judges.

The court agreed to rehear the case after an earlier three-judge panel of the same court threw out the remaining charge against Bahlul, a Yemini man and propagandist for al-Qaeda, who was convicted in a military tribunal at Guantanamo in 2008.

In upholding the conspiracy conviction, Judge Brett M. Kavanaugh said Congress is not limited by international law in allowing military commissions to try domestic offenses typically heard by civilian courts.

“The Constitution does not give foreign nations (acting through the international law of war or otherwise) a de facto veto over Congress’s determination of which war crimes may be tried by U.S. military commissions,” Kavanaugh wrote in an opinion joined by Judges Janice Rogers Brown and Thomas B. Griffith.

The votes of Judges Robert L. Wilkins and Patricia A. Millett, both appointed by President Obama, were critical to reaching a majority that also included Judge Karen LeCraft Henderson. But Wilkins and Millett ruled only on the specific facts of Bahlul’s case, without taking up the broader question on the role of military commissions.

In a 67-page dissent, three judges said there are “constitutionally prescribed boundaries” between military and civilian courts and that the prosecution could have instead charged Bahlul with recognized war crimes or charged him in federal court.

Judges David S. Tatel, Judith W. Rogers and Cornelia T.L. Pillard said in their dissent that even though Bahlul has admitted to ­serving as bin Laden’s personal secretary and making al-Qaeda recruitment videos, the “challenges of the war on terror do not necessitate truncating the judicial power to make room for a new ­constitutional order.”

Had the full court invalidated the conspiracy charge in its ruling Thursday, it would have made it more difficult for the government to prosecute low-level detainees at Cuba’s Guantanamo Bay.

Stephen Vladeck, a University of Texas law professor who filed a brief on behalf of Bahlul, said the case is likely to be appealed to the Supreme Court.

Without a clear majority rationale in its ruling, Vladeck said the opinion does “nothing to settle the basic, fundamental questions that have plagued the commissions since their inception.”

At oral arguments before the full court, Justice Department lawyers urged the judges to “be wary of setting outer bounds” that curtail military tribunals.

Bahlul’s lawyer said that the government’s position would allow military tribunals to usurp the traditional role of civilian courts in handling domestic crimes.

“The political branches have replaced judicial power with a military trial chamber,” Bahlul’s attorney, Michel Paradis, told the court late last year.

Throughout Kavanaugh’s opinion, he invoked not just legal precedent but also American history, including the military commissions for those charged with conspiring to kill then-President Abraham Lincoln.

The court, he said, must defer to Congress and the president who has “determined that employing military commissions to try unlawful enemy combatants for their war crimes is an important part of the overall war effort.”

The three judges disagreed: “Historically, the military has not been in the business of ­prosecuting individuals for crimes and locking them up for life. Its primary mission has always been to defeat our enemies on the battlefield.”

The court’s chief judge, Merrick Garland, participated in oral ­arguments but recused himself from the decision because of his pending nomination to the ­Supreme Court.