Four people were fatally stabbed in Southern California on Wednesday in a spree of violence that involved multiple robberies and attacks in two cities, police said.

The suspect, 33, was in custody Wednesday, but his identity was not immediately disclosed.

Police said there was no threat to the public.

"These are all random acts of violence. Our suspect was not associated with any of our victims," Garden Grove police Lt. Carl Whitney said.

Garden Grove police work the scene of a stabbing in Garden Grove, Calif., Wednesday, Aug. 7, 2019. A man killed multiple people and wounded others in a string of robberies and stabbings in California's Orange County before he was arrested, police said Wednesday. Alex Gallardo / AP

The attack was not thought to be racially motivated, he said. All the victims are Hispanic, as is the suspect, Whitney said.

The spree stretched for two hours, during which time police received calls reporting armed robberies at multiple sites. The motive in at least some of the attacks was believed to be robbery, but police are still investigating, he said.

"This is a heinous act," Whitney said.

Two men were fatally stabbed at an apartment complex in Garden Grove, and a man at a Santa Ana Subway restaurant and a security guard inside a 7-Eleven across the street were fatally stabbed at those locations, police said.

A woman at an insurance company was stabbed at a robbery there, and a man pumping gas at a Chevron station was stabbed and had his nose almost severed, Whitney said. Both were taken to hospitals and are expected to survive.

"This guy was full of anger, and he harmed a lot of people tonight," Whitney said.

Whitney said the crime spree started shortly after 4 p.m. when Garden Grove police were called to the apartment complex on a report of a burglary.

While there, police were called to a robbery at a bakery where no one was hurt. They were then called back to the apartment complex just after 5 p.m. where two men were found fatally stabbed, one on a balcony and one inside, Whitney said.

At 5:40 p.m., police got another call of a robbery at a check-cashing business where no one was hurt, and about 25 minutes after that call, there was the robbery at the insurance business where the woman had been stabbed. Shortly after, the man at the gas station was attacked, he said. Both are stable at hospitals.

In Santa Ana just after 6:15 p.m., police responded to the Subway restaurant where the man was killed and then the security guard at the 7-Eleven was found stabbed and later died, Santa Ana police Cmdr. Robert Rodriguez and Whitney said.

Detectives found a silver Mercedes that they had identified during the spree parked at the 7-Eleven, Whitney said.

The suspect, who was carrying a large knife and a handgun he had taken from the guard inside, walked out of the store and dropped both weapons when ordered to do so by police, who then took him into custody, Garden Grove police Chief Tom DaRé said.

The suspect was confronted by undercover police outside the store.

The case is under investigation by the Garden Grove and Santa Ana police departments, as well as the Orange County District Attorney.

"Four people needlessly lost their lives tonight," Whitney said. "This was a brutal attack."

The suspect lives near the apartment where the first two men were found killed, and the apartment appeared ransacked, Whitney told reporters later Wednesday night.

Whitney said the man killed at the Subway is believed to have been a customer. Officials earlier identified that victim as an employee.

Garden Grove and Santa Ana are neighboring cities in northern Orange County, south of Los Angeles.