One of the two Yemenis freed from a U.S. military prison in Afghanistan and repatriated Tuesday had been diagnosed with leukemia, a U.S. military official said.

It’s not clear when the U.S. learned that Amin al-Bakri was sick and whether that played a role in his release from the detention facility near Bagram air base.

The official, who spoke on condition of anonymity because detainee medical histories are confidential, did not know how advanced Bakri’s disease was or his prognosis.

Bakri, 46, was released along with fellow national Fadi al-Maqaleh, 28. The two men had fought for years in U.S. courts to secure their freedom and earlier this month had petitioned the U.S. Supreme Court.

The two had been held without charge for more than a decade.

Bakri, a gem salesman, was detained in Thailand in 2002 at the behest of the CIA as he was headed to the airport to return to Yemen after a five-day business trip. Maqaleh left Yemen in 2004 while still in high school. He was picked up and held in Iraq before being moved to Afghanistan.

Their release could have a bearing on whether dozens of other Yemenis held at the military prison at Guantanamo Bay, Cuba, also are sent home. Of the 86 Yemenis held at Guantanamo, 58 have been cleared for release by an interagency task force after President Obama assumed office. Obama last year lifted his self-imposed ban on transferring Yemenis home, but U.S. officials continue to worry that the country is too unstable to successfully integrate returning detainees.

If Yemen demonstrates it can successfully handle the return of Bakri and Maqaleh, it could provide a persuasive argument to begin releasing Yemenis from Guantanamo.

Obama has said he remains committed to closing the prison at Guantanamo where 149 detainees are held.

Tina Foster, a lawyer for Bakri and Maqaleh, said the men were being held in Sanaa, the Yemeni capital. She said it was unclear if they would be prosecuted or released under some kind of supervision.

“Nobody told us what the plan is,” she said.

A Yemeni official said the men were being held in a secure facility while being processed. The official added that Bakri was in “bad shape” physically.

The Pentagon is moving swiftly to empty the prison in Afghanistan as the U.S. and its allies draw down combat forces in Afghanistan by the end of this year. Obama has authorized a small training and counterterrorism force to stay in the country until 2016.

Two U.S. military officials said the number of detainees held in Bagram has now fallen below 30, down from more than 50 in December. One of the officials said as of last week there were 27 detainees left at the prison known as the Parwan Detention Facility.

All of the detainees are non-Afghans, most of whom were captured by U.S. forces on the Afghan battlefield. The U.S. turned over the bulk of its prison facilities, and all Afghan nationals it was holding in them, to the Afghanistan government in March 2013.

“As we wrap up our combat mission in Afghanistan, we are working diligently to resolve the disposition of the few remaining non-Afghan detainees in U.S. custody at Parwan,” said Lt. Col. Myles B. Caggins III, a Pentagon spokesman for detainee policy. “The decision to transfer a detainee is made only after direct conversations with the receiving country about the threat a detainee may pose after transfer.”

A number of Pakistanis also have been released recently. Human rights activists said last week that nine Pakistanis had been repatriated; another 10 Pakistanis were released in May. In February, The Washington Post reported the U.S. was holding 35 Pakistanis.

A Jordanian, a pair of Tunisians and a Russian are also being held at the prison.

The Obama administration is considering prosecuting a handful of these detainees in either the federal courts or military commissions. The Russian is at the top of the prosecution list, U.S. officials have said.

A person familiar with the detainee population said a man from Kazakhstan, Farabi Ryskulov, was sent back to his native country on Aug. 4, despite concerns he might be tortured.

“Our priority is to ensure the receiving country mitigates potential threats and assure measures for humane treatment of transferred detainees,” Caggins said in a statement.

Foster called the detention of her clients unlawful and said she believed the U.S. might have wanted to free the men before the Supreme Court weighed in. Starting in 2010, military detainee review boards had cleared both men for release on three occasions.

In 2012, Yemen agreed to accept Bakri and Maqaleh. At the time, the Yemeni foreign minister said the two men would be denied passports and prevented from traveling after being resettled.

Karen DeYoung and Julie Tate contributed to this report.