Abu Khattala was photographed shortly after his apprehension by U.S. special forces near a villa south of Benghazi, Libya, onJune 15, 2014. (U.S. Attorney's Office for the District)

Federal prosecutors Monday painted the attacks that killed four Americans at U.S. diplomatic and intelligence facilities on Sept. 11 and 12, 2012, in Benghazi, Libya, as a bloody act of anti-American violence led by an Islamic militant whose trial will test the ability of U.S. courts to try foreign terrorism suspects captured abroad.

As the trial of Ahmed Abu Khattala, 46, opened in federal court in Washington, government lawyers said Khattala did not set fire to a diplomatic compound where Ambassador J. Christopher Stevens and an aide died of smoke inhalation during that long night or launch mortar shells at dawn that killed two security contractors on a rooftop at a nearby CIA annex.

But he “planned the attacks. He instigated others,” Assistant U.S. Attorney John Crabb Jr. said. “Why? Because they were Americans.”

“This is a terrorism case, plain and simple. . . . That man right there, Abu Khattala, hates America with a vengeance. Abu Khattala’s hatred simmered until it boiled over,” Crabb told a jury of 12 and three alternates, all from the District.

Jurors on Monday also heard testimony from Stevens’s State Department bodyguard and the last man to see him and the aide alive, crawling on their bellies under fire and amid explosions, gasping and vomiting from the smoke.

File photo of the USS New York in the Hudson River. Abu Khattala was interrogated by a U.S intelligence team for about three days onboard. (N/A/U.S. Attorney's Office for the District)

Stevens was the first U.S. ambassador since 1979 killed in a violent attack.

The bodyguard, Scott Wickland, said he had kept one hand on Stevens as he tried to lead them to a bathroom with a small window and fresh air.

Wickland yelled, “ ‘We can make it,’ ” he testified.

“I was right next to him and then, that’s it. . . . I couldn’t find them anywhere,” he told jurors.

“Within that eight meters, they disappeared. . . . To this day, I don’t even know where they went, and that’s it.”

Abu Khattala — in court with a full, white beard; long white shirt; dark pants and sneakers — did not visibly react but listened closely to interpreters through headphones throughout the day.

He has pleaded not guilty to 18 counts, including conspiracy, murder and material support of terrorists in the deaths of Stevens, State Department communications expert Sean Patrick Smith and security contractors Tyrone S. Woods and Glen Doherty, for which he faces up to life in prison if convicted.

“Mr. Khattala said it himself. ‘I didn’t do all this by myself. Others were involved and helped me,’ ” Crabb said, citing allegedly self-incriminating statements by Abu Khattala, including those made to a key Libyan witness identified only as “Ali,” a pseudonym used for safety concerns.

Prosecutors also disclosed for the first time that Ali received $7 million from the U.S. government after befriending Abu Khattala, reporting statements Abu Khattala made over months, and then luring him to the beachfront location where Abu Khattala was captured by U.S. Special Operations forces in June 2014.

Abu Khattala’s court-appointed defense team told jurors that he did not participate, plan or mastermind any attack, and he had arrived at the U.S. compound after the Americans had left.

Abu Khattala, the only person to face trial in the United States for the attacks, is “simply someone who can be blamed because someone has to be blamed for this tragedy,” Jeffrey D. Robinson said. “We’re not here to tell you that’s not a tragedy, but the evidence will show that Mr. Abu Khattala is not the person responsible for that tragedy.”

Robinson in opening statements also told jurors that the witness, Ali, was hired for pay and would “say whatever it takes to make that work and to collect.”

Robinson portrayed Abu Khattala as an auto repair shop owner who fought in his country’s civil war on the side of the United States to free citizens from dictator Moammar Gaddafi. He urged jurors to view testimony from Libyan witnesses skeptically, calling the government’s account “a story” that relied on a highly paid informant and noncredible testimony by political enemies of Abu Khattala, a militant who was the head of an extremist Islamic brigade known as Ubaydah ibn al Jarrah that seeks to establish sharia law in Libya.

The federal trial in Washington, five years after the attacks, returned a focus to the criminal prosecution in an episode that became a political lightning rod during last year’s presidential campaign for Hillary Clinton, who was secretary of state in 2012.

It also poses a high-profile test of U.S. counterterrorism policies developed in recent years to capture suspected terrorists overseas and interrogate them for intelligence purposes, while preserving the right to prosecute them in civilian court. Abu Khattala’s trial judge, U.S. District Judge Christopher R. “Casey” Cooper, an Obama appointee, issued one of the first major rulings upholding the constitutionality of the blended civilian and military operations.

Prosecutors are expected to call dozens of witnesses in a trial anticipated to last between four and six weeks, including relatives of victims, U.S. security personnel involved in rescue operations on the ground, and multiple Libyan nationals and eyewitnesses who will testify against Abu Khattala using pseudonyms for their and their families’ safety.

Security was high outside the courtroom — bomb-sniffing dogs and armed U.S. Marshals Service deputies patrolled the hallways — while a packed courtroom included rows of prosecutors; two FBI case agents and an analyst, Undersecretary of State Thomas A. Shannon Jr.; newly confirmed U.S. Attorney for the District Jessie K. Liu, whose office is leading the prosecution; and Federal Public Defender A.J. Kramer, whose office is part of the defense.

Prosecutors opened the trial in a 90-minute statement that began with a visceral, emotional appeal to jurors, showing Stevens’s biographical State Department photo, smiling in front of a U.S. flag on large video screens. The photo was replaced by an image of Stevens in death, his eyes wide open, face pale, and mouth ringed in black soot.

Prosecutors relied on a table-sized, three-dimensional model of the diplomatic compound to orient jurors and played multiple security camera videos allegedly showing Abu Khattala and associates entering its buildings on the night of the attacks.

Crabb also alleged that cellular phone records show Abu Khattala placed and received calls from associates throughout the night of the assaults.

Stevens and Smith died of smoke inhalation after attackers set ablaze a villa containing a “safe room” at the compound late on Sept. 11, 2012.

As midnight neared, prosecutors said Abu Khattala showed up on internal security cameras, entered a mission office and oversaw the looting of data about a nearby CIA annex that soon came under mortar fire, killing Woods and Doherty.