A Libyan man examines the inside of a U.S. diplomatic post in Benghazi, Libya, in September 2012 after an attack that killed four Americans, including Ambassador J. Christopher Stevens. (Mohammad Hannon/AP)

The Justice Department announced Tuesday that it will not seek the death penalty against Ahmed Abu Khattala, 54, a U.S.-designated terrorist whom prosecutors accuse of leading the 2012 attacks in Benghazi, Libya, that killed four Americans.

The announcement, contained in a notice to the federal trial court in Washington, clears the way for a major terrorism trial in the nation’s capital, the first in the United States since 2015, barring a plea agreement by Abu Khattala.

The decision ended a lengthy review after President Obama aired concerns in October that while he supported capital punishment in theory, he found it “deeply troubling” in practice.

The move marked somewhat of a shift for the Justice Department, one year after federal prosecutors last May secured a death sentence in a capital terrorism case against Dzhokhar Tsarnaev for the 2013 Boston Marathon bombings.

The department in November approved its first new capital prosecution under Attorney General Loretta E. Lynch — who called the death penalty an “effective punishment” before her Senate confirmation in April 2015 — against Noe Aranda-Soto, an illegal immigrant accused of human trafficking and murder in Texas.

However, analysts said the government faced a difficult calculation in the Benghazi case, pointing to complex legal, political and national security concerns that have produced a mixed record in capital terrorism cases, and to a history in which no D.C. jury has ever imposed the death penalty.

“We do these on a case-by-case basis,” a Justice Department official said, declining to elaborate. Legal observers noted challenges facing the U.S. government in bringing witnesses from Libya to testify in a U.S. courtroom amid sectarian conflict in the region.

A trial date before U.S. District Judge Christopher R. Cooper of the District has not been set.

Abu Khattala commanded a brigade absorbed by the extremist anti-Western group Ansar al-Sharia, which carried out the attacks on Sept. 11 and 12, 2012, that killed U.S. Ambassador J. Christopher Stevens and three others, according to U.S. investigators. The U.S. government in January 2014 designated Abu Khattala a terrorist and Ansar al-Sharia, an armed militia that seeks to establish sharia law in Libya, a terrorist organization.

“The department is committed to ensuring that the defendant is held accountable for his alleged role in the terrorist attack on the U.S. Special Mission and annex in Benghazi that killed four Americans and seriously injured two others, and if convicted, he faces a sentence of up to life in prison,” Justice Department spokeswoman Emily Pierce said in a statement Tuesday.

Here are top moments from the House Select Committee hearing on Benghazi where former secretary of state Hillary Clinton testified. (Sarah Parnass/The Washington Post)

The Obama administration authorized Abu Khattala’s capture in a June 2014 U.S. Special Operations raid in Libya after he was lured to a villa south of Benghazi.

He pleaded not guilty after being indicted on 18 counts, including death-eligible charges of murder of an internationally protected person, murder of an officer or employee of the United States, killing a person in an attack on a U.S. facility and providing material support to terrorists resulting in death.

In unsealing a July 2013 complaint with death-penalty-eligible charges, then-Attorney General Eric H. Holder Jr. said that an investigation was ongoing and that the arrest “proves that the U.S. government will expend any effort necessary to pursue terrorists who harm our citizens.”

A spokesman for Channing D. Phillips, U.S. attorney for the District of Columbia, referred questions about the decision by the attorney general’s office to the Justice Department.

A.J. Kramer, federal public defender for D.C., declined to comment.

The decision returned focus at least briefly to the criminal prosecution for an attack that remains politically charged — raised in Republican presidential debates and dramatized in a feature film released nationwide early this year.

Democratic presidential candidate Hillary Clinton, testifying in October before a House select committee investigating the attacks, repeated her categorical denials of the long-debunked charge that she impeded rescue attempts. However, a State Department review concluded that security was inadequate for Benghazi, and the issue has continued to spur partisan crossfire.

In the Abu Khattala case, it remains unclear what impact a decision not to seek the death penalty might have on plea talks, even as national security concerns surrounding the prosecution persist.

The situation is not unusual. The government’s record in capital terrorism cases has been mixed, with more success in cases brought against “lone wolves” acting on their own to kill on U.S. soil than in cases brought against foreign-based or foreign-trained fighters.

Libya is in the midst of a civil war, complicating the investigation and raising questions about how much prosecutors will rely on classified evidence and on how any such disclosures might affect U.S. interests in the region.

Prosecutors have already turned over about 20,000 pages of material to Abu Khattala’s defense at last notice, most of it is classified, and much of the government’s case remains secret.

The Libyan government has previously protested the U.S. seizure of Abu Khattala as a violation of Libyan sovereignty.

In court papers, U.S. authorities alleged that Abu Khattala told others he believed the American diplomatic presence in Benghazi was cover for a U.S. intelligence-gathering facility and vowed to “do something about this facility.”

Abu Khattala drove with attackers to the U.S. diplomatic post and participated in the assault that began about 9:45 p.m. that night, “coordinating the efforts of his conspirators and turning away emergency responders,” prosecutors alleged. Stevens and State Department communications expert Sean Patrick Smith died of smoke inhalation after attackers set ablaze a villa containing a “safe room” at the compound.

Near midnight, Abu Khattala allegedly entered a mission office and oversaw the looting of data about a nearby CIA annex that soon came under mortar fire, killing security contractors Tyrone S. Woods and Glen Doherty.

Last year, a lawyer for Abu Khattala, standing next to the defendant,  said in court that “everyone agrees what happened in September 2012 was a tragedy and Americans suffered a tragic loss.” Defense attorney Jeffrey D. Robinson added, “Mr. Abu Khattala agrees it was a tragic loss but disagrees he is the person responsible for it.”

Death-penalty experts said they were not surprised at the government’s move, noting that terrorism prosecutions for the deaths of Americans remain extremely rare and highly case-specific.

Federal prosecutors have sought the death penalty for an accused terrorist at least 14 times since 1993, but only one was executed — Timothy Mc­Veigh, the 1995 Oklahoma City federal-building bomber.

McVeigh is one of three people executed by the U.S. government since 1964.

Tsarnaev, the most recent addition to federal death row, also is a U.S. citizen, of Chechen heritage, who purportedly was inspired by Islamist radicalism but not in contact with any organized group.

Others who faced the death penalty but pleaded guilty and received life sentences include serial bomber Eric Rudolph, an avowed white supremacist convicted in 2005 for explosions at Atlanta’s Olympic Park in 1996 and at an Alabama abortion clinic, and Theodore Kaczynski, the Unabomber, who was convicted in 1998 of leading an 18-year-long anti-technology and anarchist crusade from his remote Montana cabin that killed three and injured 28.

Since 2000, the U.S. government has failed to persuade federal juries to impose the death penalty in other high-profile cases.

A jury in Alexandria, Va., in 2006 rejected the U.S. government’s four-year effort to obtain a death sentence against al-Qaeda conspirator Zacarias Moussaoui, a French citizen who received life in prison for conspiring in the 2001 terrorist attacks on the World Trade Center and the Pentagon.

Manhattan jurors in 2001 deadlocked in the al-Qaeda-led bombings of two U.S. embassies in East Africa in 1998 that killed 214 people, resulting in life sentences for a Saudi and a Tanzanian man convicted in the attacks.

The Moussaoui prosecution in particular was criticized by some analysts from both the left and right. Conservative critics said the result highlighted the drawbacks of trying terrorists in civilian courts. Liberal experts said the government wasted years and millions of dollars seeking Moussaoui’s execution when a plea deal and life sentence was an option from the outset.

Other observers questioned whether U.S. pursuit of the death penalty helps or hinders foreign-government cooperation with U.S. counterterrorism efforts.

“There are tensions between public trials and national security,” said Robert Dunham, executive director of the Death Penalty Information Center, including what kinds of evidence can be admitted in a capital case and the need not to compromise anti-terrorism efforts abroad. “This is a highly extraordinary case.”

The prospect of a death-penalty trial in Washington poses hurdles for both sides.

Trying a foreign terrorist accused of the overseas killing of a senior U.S. diplomat and other federal employees could be expected to draw a sympathetic jury in Washington, seat of the national government.

However, since Congress reinstated the federal death penalty in 1988, only a handful of eligible cases have gone to federal trial in the District, and none resulted in a death sentence.