— Investigators are looking into family connections to determine what led a man to kill his brother and father before going on a shooting rampage across Santa Monica.

An official briefed on the matter said Saturday that police are trying to piece together what started as a domestic-violence incident and ended up at a college campus with five dead, including the gunman.

The official was not authorized to speak publicly and requested anonymity.

The killing began at a Santa Monica house where neighbors said a man lived with one of his two sons. The house was set ablaze and two bodies were found inside.

SWAT teams later searched the Los Angeles apartment of the man’s ex-wife and questioned neighbors about the son who lived with her.

The gunman, dressed in black and carrying a semi-automatic rifle, walked calmly through the Santa Monica College campus after killing his father and brother at their home and another man near the school, authorities said. He killed a woman outside the library moments later, before dying from police gunfire.

Trena Johnson, a longtime administrative assistant working in the dean’s office, heard gunfire and looked out the window around noon Friday. Students were jumping out of windows of nearby buildings to get away. A man in black with a “very large gun” shot a woman in the head outside the library, she said.

“When I saw her shot in the head and she fell to the ground we ran out the back door,” Johnson said. “I haven’t been able to stop shaking.”

Five people also were wounded in the rampage, police said.

The violence, which lasted little more than 10 minutes, started when the gunman began shooting at a house, and it caught on fire. Two bodies were later found inside, police Chief Jacqueline Seabrooks said.

As flames rose from the house, the man, wearing what appeared to be a ballistic jacket, carjacked a woman at gunpoint and directed her to drive to the college campus, having her stop so he could shoot along the way, police said.

He wounded one woman in a car, and she was in critical condition late Friday. He fired on a city bus where three women were left with minor injuries. The gunman also fired on police cars, bystanders and pedestrians, police said.

From there he went to the college, police said.