Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A black California man who killed three white people in Fresno in 2017 was convicted of murder Wednesday in the racially motivated rampage.

Kori Ali Muhammad, 42, was found guilty on three counts of second-degree murder and one count of first-degree murder in the April 18, 2017, slayings as well as a previous killing of a security guard outside a motel, NBC affiliate KSEE of Fresno reported.

The trial will move to the sanity phase Monday, and the outcome of that will determine whether Muhammad is hospitalized or sentenced to prison, the station reported.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Muhammad surrendered to police after he fired 17 shots in less than a minute at four Fresno locations in an area near the city's office of Catholic Charities, authorities have said.

The Fresno police chief said at the time that Muhammed is a racist who planned "to kill as many white males as possible," and who advocated for the creation of a separate country for all of the United States' non-white residents.

Zackary David Randalls, 34, of Clovis, and Mark James Gassett, 37, and David Martin Jackson, 58, both of Fresno, were killed in the attack.

At the time, Muhammad was wanted in connection with the shooting death of Carl Williams, 25, a security guard at a Motel 6, a week prior.

The convictions handed down Wednesday relate to all four killings. Muhammad in March testified that he killed all four people and that in the downtown Fresno shootings, he had planned to kill white men.

Muhammad's attorney, Richard Beshwate, said the jury was conscientious but he would have liked all of the convictions to be second-degree murder "based upon his mental-health issues," according to video from The Fresno Bee newspaper.

"We'll see where we're at in the next phase," Beshwate said.

If the jury finds Muhammad was not sane at the time of the killings, he would spend the rest of his life in a state hospital, according to the newspaper. If they decide he was sane, he could face the death penalty or life in prison.