MARSEILLE, France — The red-helmeted marine firefighter was firm. “Right,” he told the anxious families gathered around him, “we’re closing up the building.”

Bewildered and frightened, they climbed the darkened, rickety staircase of their building on the Rue Jean Roque, past the chunks of missing plaster and thick lines of cracks, some big enough to put an arm into. On the firefighter’s orders, they gathered their belongings and then left, for the last time.

Their decrepit five-story apartment building, long ignored by city officials, was now deemed unsafe. Marseille city leaders, on the defensive after ignoring expert warnings, were racing to respond to a public outcry after two buildings collapsed this month, killing eight people.

Nervous officials have since evacuated 1,054 people, and counting, from 111 crumbling apartments in the heart of the ancient and dingy Mediterranean port. But a 2015 report written for France’s minister of housing found that 40,000 dwellings in Marseille were unsafe — which is 10 percent of all unsafe buildings in France, and affects 100,000 of the city’s inhabitants.