PARIS (Reuters) - Firecrackers sparked panic in a Mediterranean seaside town late on Sunday, 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 canceled 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.