US Consulate
The U.S. Consulate in Benghazi is seen in flames during a protest on Sept. 11, 2012 REUTERS

A Libyan jihadist leader who 'masterminded' a 2012 attack on a US consulate in Benghazi that left four Americans dead, including a US ambassador to Libya, has been convicted of terrorism.

Ahmed Abu Khattala, a leader with the Ansar al Sharia militia, had fought to depose Libyan dictator Moammar Gaddafi, but decided to attack US targets in 2012, the court heard.

His rebel group's raid on the diplomatic compound and a CIA annex in the city left US ambassador to Libya, J. Christopher Stevens, and three other Americans dead.

Khattala, 46, was accused of masterminding the attack during an eight-week trial in a US federal court in Washington.

And on Tuesday (28 November) Khattala was convicted of several terrorism-related charges but found not guilty of other charges including murder.

Hillary Clinton, who was then Secretary of State, was criticised in the wake of the incident by prominent Republicans claiming she had failed to provide adequate security for the men, ignored warnings of violence and did not respond quickly enough.

Congressional and State Department investigations found the accusations to be untrue.

Khattala now faces up to 60 years in prison after being found guilty of conspiracy to provide material support for terrorism, maliciously destroying and injuring dwellings and property as well as using and carrying a semi-automatic weapon during a crime of violence.

A protester reacts as the U.S. Consulate in Benghazi is seen in flames September 11, 2012. Reuters

Benghazi-born Khattala, who served time in the notorious Abu Salim prison in Tripoli in 2011, was acquitted of 14 of the 18 charges after a jury deliberated for five days.

The attack took place at around 9.45pm local time on 11 September when a gang armed with AK-47-type rifles, handguns and rocket-propelled grenade launchers, attacked the diplomatic compound.

Stevens and fellow diplomat Sean Smith died in the initial attack while two other state department contractors, Tyrone Woods and Glen Doherty, were killed by mortar fire when they escaped to the nearby CIA facility.

A construction worker by trade Khattala denied any involvement in the operation, and links to al-Qaeda, while prosecutors said Khattala entered the destroyed buildings "supervised the exploitation of material from the scene" by armed men, reported the BBC.

According to prosecutors Khattala "attempted to obtain various types of equipment, including weapons, to defend himself from feared American retaliation for the attack".

Khattala was captured by US special forces close to Benghazi in 2014 before being transferred to a US warship, subjected to a two-stage interrogation and brought to the states to stand trial.