FORT MEADE, Md. (AP) — An Iraqi man who has been held at the Guantanamo Bay detention center for more than 15 years pleaded guilty Monday to war crimes charges for his role in al-Qaida attacks against U.S. and allied forces along with civilians in Afghanistan.

The pleas by the prisoner known as Abd al-Hadi al-Iraqi before a military commission at the U.S. base in Cuba amount to a legal milestone, aiding efforts to resolve the long-stalled Guantanamo tribunals and wind down operations at the detention center.

Prosecuting Hadi al-Iraqi has been delayed for years by some of the same legal and logistical challenges that have held up other Guantanamo cases as well as by his deteriorating spinal condition that has left him partially paralyzed.

Hadi al-Iraqi, who is about 60 and says his real name is Nashwan al-Tamir, was arraigned at Guantanamo in 2014 before the commission, which was set up to prosecute prisoners for war crimes in a high-security court that combines military and civilian law.

He pleaded guilty to four of five charges against him, including conspiracy and several violations of the international laws of war as an al-Qaida commander early in the conflict in Afghanistan that formally ended with the U.S. withdrawal in August.

He was facing up to life in prison but is expected to be eventually transferred out of Guantanamo and sent to a third country under the terms of his plea deal after he undergoes additional medical treatment at the base.

The U.S. said Hadi al-Iraqi was a senior figure in al-Qaida since the mid-1990s, leading a training camp for operatives in Afghanistan in the years before the organization carried out the Sept. 11, 2001, terrorist attacks.

According to military charge sheets, the prisoner also assisted the Taliban with the March 2001 destruction of the the giant, sixth century sandstone Buddha statues built into a cliff in Bamiyan province. The group deemed the famed structures offensive under their interpretation of Islam.

After the U.S. invasion of Afghanistan in response to the attacks, Hadi al-Iraqi organized deadly al-Qaida attacks against American and allied forces along with civilians in the country and in neighboring Pakistan.

The prisoner, who has a long gray beard and wore a traditional skullcap, calmly answered “yes sir” or “yes, your honor” when questioned by the military judge, Air Force Lt. Col. Mark Rosenow, if he understood the charges in a lengthy hearing to determine if he was willingly entering into a plea agreement with the government. The Associated Press viewed the proceeding from a video feed at Fort Meade, Maryland.

This is the first plea agreement in a Guantanamo case since the election of President Joe Biden, whose administration has been working to gradually reduce the number of prisoners at Guantanamo and move at least closer to being able to close it.

Plea agreements are key to the closure effort because the tribunals have dragged on for years because of legal challenges and the logistical difficulty of holding proceedings at the isolated base at the southeastern edge of Cuba.

There are 37 men still held at Guantanamo, including 10 facing active military commission cases. The most prominent is the death penalty proceeding against five prisoners charged with aiding and planning the 9/11 attacks, which is the subject of ongoing plea negotiations.