THOUSAND OAKS, Calif.—Shortly after 11 p.m. Wednesday, a 28-year-old Marine Corps veteran strode up to the front entrance of a country music bar in this Los Angeles suburb that was hosting its weekly college dance party.

As more than a hundred people sipped drinks and took line dancing lessons inside, Ian David Long, bearded and dressed in black, took out a .45 caliber pistol equipped with an extended magazine and shot the bouncer. Entering the door to the bar, he shot several more employees including a cashier while hurling...