Thousands of Pakistanis have attempted to storm Islamabad’s diplomatic enclave, as anger mounted across the Muslim world over perceived Western insults to the Prophet Mohammed.

Similar demonstrations took place in several countries, as the anger that erupted when a US group of Christian extremists released a crudely made film attacking Mohammed was further stoked by caricatures in a French magazine.

In a foretaste of what might come when tens of millions of Muslims leave their mosques on Friday after weekly prayers, crowds in Nigeria, Iran and Afghanistan chanted: “Death to France. Death to America. Death to Israel.”

In Islamabad, police fired tear gas and live rounds on Thursday as they defended the heavily guarded diplomatic district, home to Western embassies including the US, British and French missions, against mobs of club-wielding protesters.

Dozens of officers were wounded and a police post burnt to the ground before army troops were eventually called in to disperse the protesters, who had breached a wall of shipping containers designed to hold them back.

Western missions are on high alert as the United States investigates a deadly attack on one of its consulates in Libya, and ahead of Friday’s prayers, which are often a prelude to protest in the Muslim world.

The White House confirmed that FBI investigators suspected that al-Qaeda may have been linked to the September 11 attack in the Benghazi compound, which left four US officials dead, including the ambassador to Libya.

It is not yet clear whether the attack by armed militants sprang out of the protest movement against the privately produced film or whether it was a pre-planned assault by an organised Islamist faction.

But US President Barack Obama’s spokesman called the killings a “terrorist attack” and said officials were probing reports that the militants could have links to al-Qaeda or its North African offshoot.

Separately, US Secretary of State Hillary Clinton announced that a senior panel would be appointed to review security in the wake of the killings. She was also to brief lawmakers on the investigation into the attack.

US interests bore the brunt of the first wave of protests, after Christian activists released a trailer for an amateurish movie, The Innocence of Muslims, depicting Mohammed as a thuggish sexual deviant.

But this week France also found itself in the firing line after the French satirical weekly, Charlie Hebdo, printed a batch of cartoons caricaturing the founder of Islam, including two showing him naked.

French authorities banned a demonstration planned for Saturday in front of Paris’s Grand Mosque, and will close diplomatic missions, cultural centres and French schools in around 20 Muslim countries on Friday.

The French interior ministry has said it will deny all requests for permits to protest the film after a demonstration last weekend near the US embassy in Paris turned violent.

Leaders of France’s Muslim community – the largest in western Europe – said an appeal for calm would be read in mosques across the country on Friday but also condemned Charlie Hebdo for publishing “insulting” images.

Charlie Hebdo’s editor, Stephane Charbonnier, mocked those angered by the cartoons as “ridiculous clowns” and accused the government of pandering to them by criticizing the magazine for being provocative.