A Libyan militia leader has pleaded not guilty in a US federal court to a terrorism charge in the 2012 attack on the US diplomatic compound in Benghazi that killed four Americans.

Ahmed Abu Khatallah was transferred to the US District Court in Washington this morning, from a Navy warship where he had been held since he was captured on 15 June by US special operations forces in Libya.

He was charged at an afternoon hearing with conspiracy to provide material support to terrorists resulting in death in the attack that killed US Ambassador Christopher Stevens and three other Americans in Benghazi.

The attack on 11 September 2012 triggered a political fire-storm for US President Barack Obama.

Republicans accused his administration of misrepresenting the circumstances and of lax protection for diplomats.

The charge against Khatallah carries a maximum penalty of life in prison, the Justice Department said.

The department said it intended to file additional charges shortly.

Khatallah was transferred to US soil by helicopter, a US official said.

Federal charges filed against him in July 2013 but kept under court seal until this month also included killing a person on US property and a firearms violation.