A young man. A powerful weapon. And a crowded public space.

Those are the hallmarks of the now grimly familiar routine of mass shootings in the United States. And when Richard Shoop walked into the Garden State Plaza mall in northern New Jersey on Monday night, shoppers who saw him thought that they were about to find themselves in the midst of another massacre.

Mr. Shoop, 20, was carrying a weapon that was modified to look like an AK-47 assault rifle, the authorities said. He was wearing a black motorcycle helmet and was clad in black.

From the moment he fired the first shot in the air, there was chaos and confusion, as terrified shoppers fled or hid in closets, offices and bathrooms.

But Mr. Shoop was not looking to take anyone’s life but his own, according to his family and law enforcement officials.