Police say that three people were killed and one was wounded when a gunman opened fire in downtown Fresno on Tuesday morning.
Suspected attacker Kori Ali Muhammad, 39, shouted “God is great” in Arabic as police tackled and then arrested him, Police Chief Jerry Dyer said.
Chief Dyer told reporters the shooting spree was a “random act of violence”.
The suspect was wanted for the murder of a motel security guard who was unarmed when he was killed on Thursday.
“There is every reason to believe he acted alone,” Chief Dyer said, adding that there is no evidence so far to suspect a terrorism motive.
All four gunshot victims on Tuesday were white men, the Sacramento Bee reports, and Chief Dyer said that Mr Muhammad had displayed an anger against white people in Facebook posts.
“He does not like white people, and he has anti-government sentiments”, the chief said, adding that the FBI had been alerted.
The shooting began around 10:45 local time near the headquarters for Catholic Charities.
In less than a minute, 16 shots were fired, authorities say.
Witnesses said they saw a man carrying a large handgun, who reloaded it several times between shots.
The gunman then fired at a utility vehicle belonging to the Pacific Gas and Electric Company, killing the passenger.
Government offices, including the Fresno County Courthouse, have been placed on lockdown as a precaution.
Gunman kills three people at random in Fresno