A man accused of killing four men in California in suspected race hate crimes, told detectives in a recorded interview that he purposely hunted down white people as his victims.

A horrifying recording of Kori Ali Muhammad's confession was played in Fresno, California Monday as a court tried to determine whether the April 2017 murders warrant the death sentence.

He explained on the recording how the killing of motel security guard Carl Williams III, 25, led to the slaying of Zachary Randalls, Mark Gassett, and David Jackson.

'I didn't want to do nothing to law enforcement so I just found some white men to kill,' Muhammad - who is black - told police in a chilling video from shortly after his arrest.

The recording was played Monday in the California trial of Kori Ali Muhammad on Monday

He's pictured in the 2017 police interview. 'I didn't want to do nothing to law enforcement so I just found some white men to kill,' Muhammad told police in a chilling video from shortly after his arrest

Muhammad said he tried to visit a friend at the motel in April 2017, but Carl Williams III (pictured left), 25, was disrespectful to him so he shot him. Muhammad said about Zachary Randalls (right), 34: 'When I walked up to the truck, I saw a Mexican driver and a white guy. I didn't want to target the driver because he was Mexican so I shot the white dude'

Mark Gassett (left), 37, and David Jackson (right), 58, were then slain in the downtown area

Muhammad, who was 39 at the time, told cops he was fed up with racism against black people and since he was suspected of killing of one white man he may as well kill more.

Muhammad said he tried to visit a friend at the motel in April 2017, but Williams was disrespectful to him.

According to earlier testimony, Williams noticed Muhammad and told the motel manager, who asked Muhammad to register and pay a nominal visitor's fee.

Muhammad went to the office to register, but the manager testified he felt threatened and kicked out the guest and Muhammad.

A security camera recorded Muhammad approach from behind the guard and shoot him.

On the police recording, Muhammad spoke about disrespect and racism.

'It starts taking its toll on you and you get fed up with the racism,' he said. 'You get tired of letting things slide.'

After the original shooting, Muhammad ran behind the motel and climbed onto the roof of a nearby 7-Eleven, where he hid through the night.

The next morning, a Friday, he watched police officers investigate the crime scene and by evening he was in a ravine, where he told police he conducted voodoo rituals for three days. Muhammad told investigators he is Muslim but prays to seven different gods.

After emerging from the ravine Sunday, he cut his braided hair and burned it, altering his appearance from the 'wanted' photos police would release while searching for him in the death of the security guard.

Kori Ali Muhammad held up a Nation of Islam newspaper in court in Fresno, California Monday. Muhammad previously told investigators he is Muslim but prays to seven different gods

Muhammad spent Monday moving west within the city between different hiding places.

On Tuesday, Muhammad headed over to a store called The Brass Unicorn in search of crystals to use for more rituals. But it was closed, so he stopped at a Starbucks to use the WiFi. While on the run, five days after the shooting, Muhammad learned via a news app that he was wanted for Williams' killing.

After he saw that he was wanted for murder, Muhammad told officers 'he was not going to go down for shooting a security guard for disrespecting him but that he was going to kill as many white males as possible'.

Several days after the motel shooting, three more men were slain, beginning with Zachary Randalls, 34, who was in a Pacific Gas & Electric truck.

'When I walked up to the truck, I saw a Mexican driver and a white guy,' he said. 'I didn't want to target the driver because he was Mexican so I shot the white dude.'

Mark Gassett, 37, and David Jackson, 58, were then slain in the downtown area.

Muhammad immediately acknowledged he had been arrested 'because I killed those people and the security guard'.

Muhammad's defense says he was mentally ill at the time.

This undated photo from video provided by KFSN abc30 shows Kori Ali Muhammad in court in Fresno, California. Muhammad told detectives in a recorded interview he was fed up with racism against black people and since he was suspected of killing of one white man he may as well kill more

Muhammad's defense says he is mentally ill. He could face the death penalty if he is convicted

'This is telling me that he knows exactly what's going on,' Fresno police detective Miguel Alvarez previously said. 'He knows exactly what occurred earlier.'

Alvarz noted Muhammad even returned with officers to the crime scenes and demonstrated his actions.

'As he spoke about the shooting and shooting individuals, he did so in a very callous manner,' Alvarez added.

But in court Monday he refused to sit through the entire confession. The defendant had done similar previously in the trial which is in its second week.

Footage from Monday showed his attorney Richard Beshwate tell the judge: 'Mr. Muhammad informs me he would like to go back to his cell.'

Judge Jonathan Conklin asked Muhammad: 'Recognizing your right to be present, you're asking to return back to your cell?'

Muhammad responded, 'Yes sir,' and flashed a Nation of Islam newspaper with a photograph of the Most Honorable Elijah Muhammad on as he left the court.

Muhammad could face the death penalty if he is convicted, the Fresno Bee and ABC30 (KFSN-TV) reported.

In a previous interview from jail, Muhammad admitted to the killings and told KGPE: 'Someone has to fight for all the people who died at the hands of racist white men.

'I wasn't thinking like... I'm going to kill, kill, kill. All I knew was white supremacy has to die and the people who benefit from white supremacy... are white men.'

The 39-year-old, who said he's been a victim of racial discrimination his entire life, added: 'I gave my life for the freedom of my people, the ultimate freedom of my people.'