The suspect was identified as 44-year-old Aminadab Gaxiola Gonzalez, of Fullerton, Orange police Lt. Jennifer Amat said. He had been staying at a motel in Anaheim and arrived at the scene in a rental car.
Authorities received five 911 calls reporting gunshots, and officers were on the scene within 2 minutes, the lieutenant said. Gunfire could be heard as officers arrived and the suspect fired at them, Amat said. Two officers fired back from behind the fence until the "bicycle-type cable" locks that the suspect had placed on the gates from the inside could be removed with bolt cutters.
Gonzalez was wounded and remained hospitalized in stable but critical condition on Thursday. It was unclear whether he suffered a self-inflicted wound or was shot by police.
At a Thursday morning news conference, police added the shooting, which was first reported around 5:25 p.m. Wednesday at 202 West Lincoln Ave., was not a "random act of violence" and believe it was an isolated incident.
Police recovered a semi-automatic gun and a backpack with pepper spray, handcuffs and ammunition.
Police withheld the identities of the dead but said one was a 9-year-old boy who died in the arms of his mother, who was also shot while trying to protect him, Orange County District Attorney Todd Spitzer said.
Orange mass shooting: Boy, 9, died in the arms of his mother, who was shot trying to protect her son, OCDA says
The other deceased victims were a man and two women.
"I'm here to make something very, very clear: Mr. Gonzalez is eligible for the death penalty," Spitzer said. "This is a special-circumstances case. There were multiple victims."
At an afternoon news conference, authorities released a photo taken from surveillance video that investigators said showed the armed and masked gunman during the shooting rampage. He is seen carrying an apparent firearm and backpack in the image.
Authorities say the business associated with the victims is Unified Homes, which is described on its website as "a full-service manufactured home dealer and real estate company which specializes in Orange County."
Although investigators say the shooting was not random, a motive remains unclear.
One man told reporters he was concerned his brother, who owns one of the businesses in the building, is one of the victims.
"I'm just trying to find out his well-being. He's not answering the phone...pretty scared and worried," said Paul Tovar. "I wish I knew more. I don't know. Right now, just praying really hard."
Witness Moe Reyes says he saw five officers run toward the scene and heard gunshots before he began recording what was happening, including paramedics loading someone into an ambulance.
Witnesses reported hearing two distinct sets of shots - one apparently the initial shooting and one the gunfire exchange involving police.
"I was just in my room hanging out. All of a sudden I heard five to seven gun shots go off," one neighbor said.
"And then I waited a couple minutes and the police came. And I heard a few more gunshots go off. It was a lot, quickly. Then the helicopter showed up and it was silent after that.
"We thought it was a car backfiring at first. Then it became louder and quicker and we knew it was not. It was quick gunfire shots."
Orange police say it was that city's deadliest shooting since 1997.
In December of that year, a 43-year-old former Caltrans worker who had been fired shot and killed four of his former coworkers at a state maintenance yard and then was killed by police in a gun battle.
"Orange is a very safe city," Amat said. "We don't have stuff like this that happens very often."
The Associated Press contributed to this report.