A Libyan national has been sentenced to 22 years in prison for his role in the 2012 terrorist attack on the US diplomatic mission in Benghazi, Libya that killed the US ambassador and three other Americans.

Ahmed Abu Khatallah, 47, was sentenced by a judge in Washington, the Justice Department said in a news release on Wednesday.

Khatallah was captured in Libya in June 2014 and brought to the United States to face trial in the US District Court in the US capital.

He was found guilty by a jury in November following seven weeks of trial. The government charged him with 18 counts but he was acquitted of most of them, including murder.

Prosecutors accused him of orchestrating the attack in which Ambassador Christopher Stevens and the other Americans died.

They said he was a leader of an extremist militia and in the months prior to the attack on the US mission sought to incite violence against the presence of the United States in Libya.

During the attack, according to US government evidence presented at his trial, he positioned himself on the perimeter of the compound and kept others, including emergency responders, from getting to the scene.

In the end the jury found him guilty of four charges, including providing support to terrorists, destroying property and a weapons charge.