NICE, France — He lived on the 12th floor of a high rise in a heavily immigrant housing project and was known to his neighbors only as a moody and aggressive oddball. He never went to the local mosque, often grunted in response to greetings of “bonjour” and sometimes beat his wife — until she threw him out.

The French authorities had much the same view of the man, Mohamed Lahouaiej Bouhlel, a heavyset 31-year-old from Tunisia — definitely trouble but not a grave menace to the security of the nation.

At 10:45 on Thursday evening, however, Mr. Lahouaiej Bouhlel was starting an attack that would stun and horrify his old neighbors, the French security forces and much of the world: stepping on the accelerator of a 19-ton refrigerated truck he had rented, he turned the vehicle into a highly efficient instrument of mass murder.

Zigzagging so as to hit as many people as possible as the vehicle careered down the Promenade des Anglais, alongside the Mediterranean, Mr. Lahouaiej Bouhlel transformed the celebrated French Riviera boulevard, crammed with people who had just watched a fireworks show celebrating Bastille Day, into a vast tableau of carnage and panic.

By the end of his murderous drive, when he was shot to death by the police, 84 lifeless bodies were left scattered behind him and scores of others lay gravely wounded.

“We were all like zombies, just running and screaming,” recalled Alexia Carbonne, a 20-year-old who had gone out Thursday evening with a girlfriend to watch the fireworks.