Police have now revealed the motive of the shooter who opened fire inside a crowded salon in Seal Beach, Calif. Wednesday, leaving eight people dead and one critically injured — a custody battle.

Police officers stand with Scott Evans Dekraai, 42, after arresting him following the shooting. (AP /Reed Saxon)

He was apprehended only a few blocks from the salon, carrying body armor and a number of firearms.

Friends and neighbors interviewed by Southern California Public Radio (SCPR) called Dekraai a doting father and good samaritan.

But they also recalled his frequent appearances at the salon, where he would often have angry outbursts with his former wife.

The estranged couple was in the middle of a contentious custody battle over their 8-year-old son, Dominic.

Fournier had taken out a restraining order against De Kraai Tuesday.

“I don’t want people to think he is just an evil monster. He’s a nice guy, but he must have snapped,” neighbor Stephanie Malchow told the Los Alamitos-Seal Beach Patch site. “If he was in a custody dispute, that would explain why he snapped. He loves his little boy more than anything else in the world.”

Dekraai had earlier been involved in an accident that coworkers told Los Alamitos-Seal Beach Patch had deeply affected him and left him permanently disabled.

DeKraai, who worked on tugboats, was near a tugboat with his 26-year-old coworker Piper Cameron in 2007 when the tow line snapped and knocked Cameron to the side of the boat. While Dekraai attempted to go to her aid, suffering a badly broken leg in the process, Cameron’s neck was already broken and she could not be saved.

Still, those who knew him said he was a good father and neighbor.

On Wednesday night, “stunned community members lingered outside the taped-off crime scene seeking answers,” SCPR reports.

The eight deaths shocked the placid Seal Beach, which is located 27 miles south of Los Angeles, and is the worst mass killing in Southern California since a Christmas party attack in Covina in 2008, which left 9 people dead.