Firecrackers sparked panic in a Mediterranean seaside town last night, sending a stampede of people fleeing what they feared was a gun attack, injuring dozens, French media reported.

Just a month after an attack in nearby Nice in which 85 people were killed by a truck deliberately driven into a crowd, locals and tourists in Juan-les-Pins mistook the loud bangs for gunfire and 41 were injured in the rush to get away.

Photos and video posted online showed overturned tables outside cafes that would have been full of people enjoying an evening drink in the upscale beach resort. Le Parisien newspaper reported the firecrackers had been thrown from a passing car.

Eyewitness video showed people rushing and yelling and pictures showed the injured on stretchers, with ambulances at the scene, lights flashing.

The Alpes Maritimes fire brigade said on its Facebook page that 21 people had been treated and discharged from hospital and the remaining 20 would be released soon.

Around France, people are on edge, security is tight and several events have been cancelled following a string of attacks over the past two years.

The government has maintained a state of emergency put in place after 130 people were killed in Islamist attacks in Paris in November.

At the end of July, knife-wielding attackers interrupted a church service in northern France and slit the priest's throat in an attack claimed by the Islamic State group.

Earlier this month, a flashmob in a Spanish seaside town was mistaken for a terrorist attack, sparking panic as people scrambled to get away. 

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.