A transfer-of-remains ceremony is held at Joint Base Andrews on Sept. 14, 2012, marking the return to the United States of the bodies of the four Americans killed in two attacks in Benghazi on the night of Sept. 11 and the morning of Sept. 12, 2012. (JEWEL SAMAD/AFP/GETTY IMAGES)

A Libyan militant accused of being a ringleader of the deadly 2012 attacks on U.S. facilities in Benghazi was convicted on terrorism charges Tuesday. But the jury declined to find him directly responsible for the deaths of U.S. Ambassador J. Christopher Stevens and three other Americans.

The case was seen as a test of detention and interrogation policies developed under the Obama administration to capture terrorism suspects overseas for criminal trial, with the outcome likely to figure into decisions about whether to use civilian courts for similar prosecutions.

Jurors in Washington deliberated for five days after a seven-week trial. They convicted Ahmed Abu Khattala, 46, in the attack carried out on the night of Sept. 11 at a U.S. diplomatic mission, where Stevens and State Department employee Sean Smith died as a result of a fire, and in a second attack before dawn Sept. 12 on a nearby CIA annex, where agency contractors Tyrone S. Woods and Glen Doherty were killed in a mortar strike.

The jury acquitted Abu Khattala of all but four of the 18 charges against him, finding him not guilty of the most serious ones, including murder. Abu Khattala becomes the first person convicted in the attacks, but the mixed verdict shows the challenge of investigating and bringing such cases.

At trial, his defense team said Abu Khattala was drawn to the fiery scene in his home town as a bystander. They questioned the credibility of three Libyan witnesses who testified that they saw or heard Abu Khattala take steps to plan, execute and claim responsibility for the attacks.

U.S. Ambassador to Libya Christopher Stevens, in an undated U.S. State Department photo in Washington. (Reuters)

Prosecutors presented what they called “indisputable” records linking the times of calls on Abu Khattala’s cellphone — but not call contents — and surveillance video from the attack at the diplomatic mission that they said showed he was at least a key plotter. But they were pressed to prove events that erupted over hours, five years ago, overseas, in a place where the U.S. government had little presence and local authorities were weak and divided.

Abu Khattala faces up to life in prison, including up to 15 years for each of two counts of terrorism and up to 20 years for destruction of property. He also was convicted of using a semiautomatic weapon in a crime of violence, which is punishable by up to life in prison and carries a mandatory minimum term of 10 years to be served on top of any other sentence.

Abu Khattala, wearing the same type of off-white long-sleeve shirt, gray pants and prison sneakers in which he had appeared through most of the trial, sat without expression as the verdicts were read, except to cast an occasional glance into the courtroom gallery.

His defense team, led by Jeffrey D. Robinson and assistant federal defender Michelle M. Peterson, declined to comment. Acting assistant attorney general for national security Dana J. Boente said in a statement that Abu Khattala’s “arrest and prosecution were critical steps in our efforts to identify and hold accountable those who were responsible for the terrorist attacks on our facilities in Benghazi, Libya. Our work is not done. We will not rest in our pursuit of the others” involved in the attacks.

U.S. District Judge Christopher R. “Casey” Cooper thanked the members of the jury in his chambers, after which the jurors left the courthouse a few blocks from the U.S. Capitol without commenting.

In an email to CIA employees on Tuesday, the agency’s director, Mike Pompeo, called the conviction “a small measure of justice.”

House Republicans released their report on the attack on the 2012 U.S. consulate in Benghazi on June 28. Here are the 5 most serious accusations in the report. (Peter Stevenson/The Washington Post)

“It took intelligence to find him, soldiers to assist in capturing him, law enforcement to interview him, and a legal team to put him away. [Abu Khattala’s] sentencing is to follow; but no term in prison will bring our people back.”

Abu Khattala’s trial moved the Benghazi inquiry from the partisan political realm, where Republican claims of a Democratic coverup continued throughout the 2016 presidential contest, into a courthouse, where the jury of 12 District residents sorted through six binders of exhibits and hours of video evidence.

Abu Khattala was a leader in an extremist brigade that was part of a militia seeking to establish strict Islamist rule in post-revolutionary Libya. U.S. intelligence assessments have reported that several groups were involved in the attacks, including Abu Khattala’s brigade and the larger militia.

Stevens and Smith died of smoke inhalation after militants overran the compound and set fire to the diplomatic villa. Woods and Doherty were killed on a roof at the CIA annex in a predawn mortar strike.

Abu Khattala was captured in June 2014 by U.S. commandos and interrogated and transported for 13 days aboard a Navy warship traveling to the United States.

On board, he was questioned by two teams, the first working in a classified operation to extract intelligence and the second an FBI team that collected evidence for trial under the legal safeguards provided to defendants in civilian court.

Abu Khattala is the only person brought to court in the attacks. However, on Oct. 29, during his trial, U.S. authorities brought a second suspect, from Misurata, Libya, for prosecution in Washington. That person, Mustafa al-Imam, has pleaded not guilty.

The Trump administration recently showed a willingness to continue bringing terrorism cases in civilian courts, including against additional Benghazi suspects. President Trump on Oct. 30 announced that “on my orders,” U.S. forces captured Imam to “face justice in the United States.”

Brian Egan, a senior White House and State Department legal adviser during the Obama administration, said the mixed verdict will be “cold comfort” to Abu Khattala, given the possibility of lengthy imprisonment.

“This was done, in a very challenging case, through a criminal justice system that is time-tested and respected. I think that this is a win for the U.S. government and its care in effectuating Khattala’s capture, interrogation, transfer and prosecution,” Egan said.

Before the trial began Oct. 2, Abu Khattala’s defense moved to exclude statements he made while in military and FBI custody, arguing that the shipboard interrogation without a lawyer present violated his legal rights and that the circumstances were so coercive that they negated his signed waiver of his rights to an attorney and to refrain from self-incrimination.

The government won a critical ruling when Cooper denied the motion. The decision upheld the government’s flexibility in handling terrorism suspects seized abroad.

University of Texas law professor Stephen I. Vladeck, who has written frequently about the handling of terrorism suspects, said passing judgment on the effectiveness of the civilian prosecution before sentencing is premature. “To my mind,” he said, “the verdict is much less important than whether the government at the end of the day is able to incapacitate someone like Abu Khattala,” who potentially could be imprisoned for the remainder of his life.

The judge’s pretrial rulings upholding the twofold questioning, Vladeck said, are “the far more important precedent,” from a civil liberties perspective.

The trial featured dramatic testimony by surviving State Department and CIA operators, some taking the stand under fake names and disguised in wigs and mustaches to protect their identities.

Prosecutors also relied heavily on surveillance video taken by overhead drones and cameras at the diplomatic compound and on cellphone records the U.S. government obtained from Libyan authorities.

Key testimony came from three paid Libyan informants, all testifying under pseudonyms.

They included an undercover Libyan businessman who received $7 million for aiding the United States by approaching Abu Khattala as a financial supporter after the attacks, collecting incriminating statements from him and luring him to his capture. The witness, testifying as Ali Majrisi, said he was present in 2013 when Abu Khattala, on being urged to conduct more attacks, like those carried out by al-Qaeda in Iraq, allegedly said of the Benghazi attacks: “I intended then to kill everybody [all the Americans] there, even those who were at the [Benghazi] airport.”

The trial was preceded by months of sealed litigation and negotiations over tens of thousands of pages of classified documents about the case that the government turned over to the defense.

Most physical evidence at the attack sites in Benghazi was burned or otherwise destroyed or looted, and FBI agents were given only eight hours, three weeks after the attacks, to access both sites, one testified.

“It could also be, not a lot of people in Benghazi wanted to cooperate with the U.S. prosecution effort,” said Alice Hunt Friend, who served as a Pentagon official overseeing Africa security policy matters during the Obama administration from 2009 to 2014.

One clear public lesson from the trial, she added, is “how very, very difficult it is to track individual terror threats to Americans” and to collect either the very detailed intelligence needed to prevent an attack or the evidence required to prosecute after one takes place.

“To go through the details of trying to marshal evidence sufficient to convict someone of a crime is a window into the kind of evidence needed in order to understand their tactics and to try to prevent” other attacks, Friend said. “It is an enormous challenge.”

Greg Miller contributed to this report.