PARIS — The mayor of the French city of Lille said Friday that it was canceling its annual flea market, the largest in Europe, due to fears of a terrorist attack.

Martine Aubry, a leading member of the ruling Socialist party, said she made the decision because despite the local government’s efforts to ramp up security at the event, which drew 2.5 million visitors last year, it was impossible to guarantee the safety of the crowds.

“It is a painful decision for me and a great heartache for us all,” she said. “It is our responsibility, our moral responsibility in particular, to make the decision to suspend the 2016 edition of the flea market.”

The event, originally scheduled to take place on Sept. 3 and 4, is a major revenue generator for the city, with 10,000 exhibitors setting up their stands in its streets. Hotels and restaurants are traditionally fully booked during the weekend, which gathers bargain-hunters from across the continent.

Aubry said the large number of vehicles on site made it impossible to control their merchandise constantly and systematically. She added that the presence of large crowds meant there was no guarantee victims could be properly treated and evacuated by emergency personnel in the event of an attack.

“In addition, it is reasonable to think that even in the absence of accidents, the climate of fear is such that the slightest noise or crowd movement could create a state of panic with serious consequences,” Aubry added.

France has canceled a number of events in the wake of the Bastille Day attack in Nice, in which 85 people were killed when a truck plowed into the crowd gathered to watch a fireworks display. In Paris, authorities have done away with open-air cinema screenings and nixed plans to turn the Champs-Elysées into a pedestrian zone on Aug. 7.