The US Consulate in Benghazi is seen in flames during a protest by an armed group
A US state department official was killed and at least one other American was wounded when militiamen stormed the US consulate in the eastern Libyan city of Benghazi.
It is believed the protest was held over a US-produced film that is said to be insulting to the Prophet Muhammad.
The building was set on fire after armed men raided the compound with grenades, reports the BBC.
Protests have also been held at the US embassy in the Egyptian capital, Cairo.
In the attack in Benghazi, unidentified armed men stormed the grounds, shooting at buildings and throwing handmade bombs into the compound.
Security forces returned fire but Libyan officials say they were overwhelmed.
"One American official was killed and another injured in the hand. The other staff members were evacuated and are safe and sound," Libya's deputy Interior Minister, Wanis al-Sharif told AFP.
The identity of the US official killed is not yet known. The consular worker was reported to have been shot.
Social media calls
In a statement, Secretary of State Hillary Clinton confirmed the death, saying: "We are heartbroken by this terrible loss".
"Some have sought to justify this vicious behaviour as a response to inflammatory material posted on the Internet," she said in a statement.
"The United States deplores any intentional effort to denigrate the religious beliefs of others. But let me be clear: There is never any justification for violent acts of this kind."
Reports say a militia known as the Ansar al-Sharia brigade was involved in the attack, but the group has denied the claim, the BBC's Rana Jawad in Tripoli says.
Our correspondent says many people are still armed following the conflict that overthrew Muammar Gaddafi last year.
The US state department earlier said it condemned the attack "in the strongest terms" and was working with Libyan security forces to secure the compound.
The film that sparked the demonstration is said to have been produced by a 52-year-old US citizen from California named Sam Bacile, and promoted by an expatriate Egyptian Copt.
The two men are described as having anti-Islamic views.
A trailer of the low-budget movie has appeared on YouTube translated into Arabic.
There were calls on social media networks for protests against US interests in the capital, Tripoli, but no disturbances have been confirmed, our correspondent says.
The rally followed a demonstration in Cairo, in which protesters breached the US embassy and tore down the United States flag, which was flying at half mast to mark the 9/11 attacks, and replaced it with an Islamist banner.
Thousands of protesters had gathered outside the US embassy in the Egyptian capital.
In Cairo, the US flag was torn down and set alight by the demonstrators
Egyptian protesters condemned what they said was the humiliation of the Prophet of Islam under the pretext of freedom of speech.
"Both Muslims and Christians are participating in this protest against this offence to Islam," said one protester, according to Associated Press.
The US embassy earlier issued a statement condemning "the continuing efforts by misguided individuals to hurt the religious feelings of Muslims - as we condemn efforts to offend believers of all religions".