A plaque commemorating US ambassador Christopher Stevens

A Libyan man accused of masterminding the 2012 attack in Benghazi that killed a US ambassador and three of his staff went on trial in Washington on Monday, although his lawyers said he was simply a witness to the deadly events.

Sporting a white shirt and a long beard, Ahmed Abu Khattala, 46, sat beside his lawyers in court listening to an Arabic translation of the proceedings through a headset.

The surprise attack on the US diplomatic mission in the eastern Libyan port city on September 11, 2012, and the mortar attack on a nearby CIA annex that followed shortly after, left four Americans dead, including Christopher Stevens, the first US ambassador to be killed in the line of duty since 1979.

"John Christopher Stevens choked to death by thick black smoke," said John Crabb, representing the US government as he related the events of that evening in Benghazi: around 20 armed men attacked the US diplomatic mission, setting fire to the building where Stevens and a foreign service officer, Sean Smith, had taken refuge. Both men died of asphyxiation.

The group later fired mortar rounds at a building used by the CIA, killing Glen Doherty and Tyrone Woods, two former members of the elite Navy Seals.

- 'Out of Libya' -

Addressing the jury that is expected to hear the case over a course of several weeks, Crabb accused Abu Khattala of masterminding the attack out of a burning hatred for America.

"This is a case about Abu Khattala hating America so much and wanting America out of Libya so badly," the prosecutor said.

"Abu Khattala didn't do the killing by himself, he didn't light the fire and he didn't fire the mortars," Crabb said, pointing to a plan of the compound and showing surveillance photos and film in which the accused appeared but was not  seen firing weapons or acting in a hostile manner.

"Abu Khattala planned the attack, set the attack in motion," Crabb said.

The Libyan submitted a plea of not guilty to 18 charges that included murder and providing material support to terrorists, and which could see him facing life behind bars.

"It was a tragedy: four Americans died in the service of their country," said defense counsel Jeffrey Robinson. "But Abu Khattala is not the person responsible for this tragedy." 

Robinson categorically denied the charges, calling his client a "Libyan patriot" who had "fought on the side of America" during the uprising the previous year against longtime Libyan dictator Moamer Kadhafi.

On the day of the attacks, he said Abu Khattala heard about the attack on the US mission and "went to see what was going on."

With the stricken Americans already having evacuated the building, "he walked in and he walked out. The gate was open, the Americans had left," the lawyer said.

- Test trial -

Just a few years ago, a man like Abu Khattala would likely have been transferred directly to the US base at Guantanamo Bay where he would have faced a military tribunal. 

His trial will act as a test case for foreign suspects captured by US commandos in combat conditions and brought back to face civil courts in the United States. 

After the attack, Abu Khattala did not hide from public view, but continued living in Benghazi, even giving press interviews in which he admitted to being present at the US mission the night of the attack. 

He was captured in 2014 when US special forces carried out a commando raid based on intelligence provided by a friend of the accused, who received a $7 million reward from the US government.

Abu Khattala, who had allegedly commanded an Islamist militia called Ansar al-Sharia, was whisked off to a US Navy ship where he was first subjected to a CIA-style interrogation -- in secret, and with the contents classified  -- before being questioned by FBI agents who informed him of his legal rights.

The ship took 13 days to return to the United States, its slow progress being blamed on engine problems. The defense team said the return had been delayed for as long as possible to prevent their client having access to an attorney.

Robinson said the FBI "deliberately chose not to record these statements" made during the passage back to the US.