A Libyan accused of involvement in the 2012 attack on the US diplomatic complex in Benghazi that killed four Americans, including the US ambassador, appeared Friday before a federal judge in Washington.

Mustafa al-Imam, who authorities said is approximately 46 years old, had been days earlier captured in Libya by American commandos.

Dressed in an orange prison suit, he was officially informed via a translator of criminal charges that include killing a person during an attack on a federal facility using a firearm, providing material support to terrorists resulting in death, and use of a firearm in connection with a violent crime.

The first two counts could carry a potential life prison sentence.

No details on the circumstances of Imam's capture were provided.

According to the prosecution he was in a group of some 20 armed men who on September 11, 2012 entered the diplomatic complex in Benghazi before setting ablaze a building occupied by US ambassador Chris Stevens.

The ambassador and Sean Smith, a State Department technician, died of smoke inhalation.

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

Assistant US Attorney Opher Shweiki ruled out the possibility of bail for Imam, citing a ‘serious risk of flight.’

‘He has no ties in the US; he poses a serious danger,’ Shweiki said. ‘There is no condition ensuring the defendant will appear in court.’

After the approximately 30-minute long hearing concluded US Judge Deborah Robinson ordered Imam remain in custody pending another hearing Thursday.

An alleged mastermind of the attack, 46-year-old Ahmed Abu Khattala, is already on trial in the United States, accused of being a commander of the Ansar al-Sharia militia.