Police shot in the air in an attempt to hold back the crowds, but failed to prevent them gaining access to the compound and setting fire to vehicles.
A number of people were reported to have been injured.
On Tuesday, the US ambassador to Libya was killed in a fire started after the US consulate in Benghazi was stormed.
Security force reinforcements in Sanaa used tear gas, water cannon and live fire to drive back protesters.
They have now regained control of the Sanaa compound, but protests are continuing outside.
Earlier on Thursday, US officials said they were investigating whether the attack in Libya was planned, citing suspicions that a militant jihadist group may have co-ordinated the violence.
Three other US consul staff and several Libyans died in that attack, along with Ambassador Christopher Stevens, who is believed to have died from smoke inhalation.
There have also been clashes in the Egyptian capital, Cairo.
On Wednesday, demonstrators in Cairo angry at the film – Innocence of Muslims – breached the walls of the US embassy and tore down the flag. Clashes continued in the early hours of Thursday morning.
President Mohammed Mursi has appealed for calm, saying Egyptians “reject any kind of assault or insult” against the Prophet Muhammad.
“I condemn and oppose all who… insult our prophet. [But] it is our duty to protect our guests and visitors from abroad,” he said in a statement broadcast by state media.
“I call on everyone to take that into consideration, to not violate Egyptian law… to not assault embassies.”
Security has been increased at US embassies and consulates around the world in response to the rising tensions.
US President Barack Obama has vowed to work with the Libyan authorities to bring those behind the Benghazi attack to justice.
S8awL6mCrUc -ab9jKe8ShMThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…