Indonesian police fired teargas and a water cannon to break up a protest outside the American embassy in Jakarta, as anger over the Innocence of Muslims film continued to spread around the Muslim world.

Hundreds of hardline Islamists, some of them throwing rocks and fire bombs, marched on the embassy calling for the film's producer to be executed and for an official apology from the US.

In other protests overnight:

Shots were fired in the Afghan capital Kabul, where cars were set on fire by protesters

Shots were fired in the Afghan capital Kabul, where cars were set on fire by protesters Police fired warning shots to disperse protesters in the Pakistani city of Karachi, as the country's government blocked YouTube

Police fired warning shots to disperse protesters in the Pakistani city of Karachi, as the country's government blocked YouTube Hezbollah leader Hassan Nasrallah made a rare appearance at a peaceful protest in Beirut.

The Jakarta protests marked the first time the protests had turned violent in the world's most populous Muslim nation.

Hundreds of members of the Islamic Defenders Front and another hardline group appeared to take police by surprise when they began throwing rocks at the embassy.

Protesters burned police uniforms in the road and smashed up a fire truck.

In response police fired tear gas into the crowd.

Riot police reportedly pushed the protesters back, and they agreed to take a break for afternoon prayers.

The protest, however, ended well before the 6:00pm deadline.

Jakarta police spokesman Rikwanto said one police officer was injured by a stone being thrown by a protester.

"We cannot say for the time being how many protesters have been arrested," he said.

"We used tear gas, water cannon and warning shots, which are in accordance with standard procedures for violent protests of this kind."

He did not say if police were firing live ammunition or blanks.

Earlier about 50 students trampled on the American flag and threw eggs at a US diplomatic mission in the city of Medan, capital of North Sumatra province.

Indonesian protesters burn a mock US flag during the protest outside the embassy ( Reuters: Beawiharta )

ABC/AFP