A man who authorities said fatally shot three men, apparently chosen at random, had posted on social media a dislike for white people and government officials, Fresno, California, police Chief Jerry Dyer said.
All three men killed in Tuesday's shootings are white. The suspect, Kori Ali Muhammad, yelled "Allahu Akbar" (God is greatest) when he was arrested, officials said.
The gunman shot a PG&E truck passenger and two other men in downtown Fresno, Dyer said.
Muhammad, 39, will face four counts of murder and two counts of attempted murder, officials said. He also is accused of opening fire on two people who were not injured.
Dyer said the slain men are believed to have had no connection to Muhammad. The chief said it was too early to tell whether terrorism was a factor.
Two of those shot at were near Catholic Charities and were clients of the social services agency, Dyer said.
Muhammad was being sought in the April 13 slaying of Carl Williams, 25, an unarmed security guard shot outside a Fresno Motel 6.
Police had issued a plea for the public's help to find Muhammad. He is homeless, and was believed to be armed, officials said.