Thousands of people have rallied across Pakistan to denounce an anti-Islam film with protesters burning US flags and effigies of President Barack Obama, and urging Islamabad to sever ties with Washington.

At least eight people were injured when protesters clashed on Sunday with police outside the US consulate in Pakistan’s port city of Karachi, officials said.

Police fired bullets in the air and used tear gas and water cannon to disperse some 1,000 people at the rally organised by a Shiite religious organisation, according to an AFP photographer.

At one stage protesters broke through security cordons and got close to the heavily guarded US consulate, pelting the building with stones.

They chanted “Down with America”, “We will sacrifice our lives to safeguard the honour of the Prophet” and “Hang the filmmaker”.

City police chief Iqbal Mehmood told AFP at least 20 people were arrested.

Richard Silver, a spokesman for the US consulate, said there had been no damage or injury to any personnel at the mission.

Also in Karachi some 1,500 people joined a rally organised by the pro-Taliban Jamiat Ulema-e-Islam (JUI).

Elsewhere in Pakistan, more than 6,000 people gathered in the eastern city of Lahore to condemn the movie, according to local police estimates.

Organised by the banned charity Jamaat-ud-Dawa, which is seen as a front for the Lashkar-e-Taiba terror group blamed for the 2008 Mumbai attacks, the protest remained peaceful.

Addressing the rally, Jamaat-ud-Dawa leader Hafiz Saeed demanded US diplomats be expelled from Pakistan and accused the US of conspiring against Muslims.

He also announced plans to hold a long march towards Islamabad on the issue but did not give any date.

The low-budget movie, entitled Innocence of Muslims, has sparked fury across the Islamic world for mocking the Prophet Mohammed, and for portraying Muslims as immoral and gratuitously violent.

Police have beefed up security around US missions in Pakistan after violent attacks on American consulates and embassies in Egypt, Libya and Yemen.