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 -ab9jKe8ShMImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…