FRESNO, Calif. — Five days before a rampage that left three men dead, Kori Ali Muhammad shot an unarmed security guard who he felt had insulted him at a Motel 6 when he visited a woman at the hotel, police said.

Muhammad shot the guard, 25-year-old Carl Williams, multiple times at close range shortly after 11 p.m., police said — an act that would set off a chain of events leading to Tuesday's mass shooting.

Police say Muhammad gave rare and unusual details about his movements and the killings over several hours of questioning following his arrest, even returning with officers to the crimes scenes and demonstrating his actions.

"As he spoke about the shooting and shooting individuals, he did so in a very callous manner," said Fresno Police Chief Jerry Dyer.

After the original shooting, Muhammad ran behind the motel and climbed onto the roof of a nearby 7-Eleven, where he hid through Thursday night. Friday morning, 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, 39, 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.

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 where he got on the internet for the first time since Thursday night and learned he was a suspect in the guard's murder.

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," Dyer said.

Shortly before 11 a.m., he approached two men sitting in a Pacific Gas and Electric Co. truck on a tree-lined street in downtown Fresno. He told police he noticed the driver was Latino and the passenger was white so he shot four rounds into the passenger side. He killed Zackary Randalls, 34, a father of two preschoolers who had just started work as a customer-service representative for the utility and was doing a ride-along.

In the next three minutes, police say Muhammad killed two more people and shot at several others, firing 17 rounds.

Muhammad shot at another white man who had just walked out of a house, but he missed. He fired one round into a car that drove by, but then realized the people in the car were Latina and stopped shooting.

Mark Gassett, 37, had just picked up groceries at a Catholic Charities building when Muhammad shot him in the chest, and fired twice more after he fell to make sure he was dead.

Gassett's ex-wife Lisa Gassett told The Fresno Bee that he had faced hard times but had been working to improve his life. The couple has two children.

"He would give his shirt off his back for anybody," she told the newspaper. "That is the kind of guy he was."

Muhammad then set his sights on three white men standing at a bus stop. He shot and the men scattered. Muhammad said he selected the one who looked older and heavier, chasing David Jackson, 58, to the parking lot of a Catholic Charities building, where he shot him twice, killing him.

Jackson and his roommate, Mark Greer, had only stopped at the building to use the bathroom.

Greer said Jackson tripped over a curb in the parking lot, falling down when he was shot. Greer was able to get away.

"I was too fast for him, but David couldn't run that good," he said.

Muhammad then ran from the parking lot, wrapped his gun in clothing and set it on the ground. He encountered a man carrying a box of food. They spoke. The man then picked up the gun and fled.

Police are pleading for the man to turn the weapon in.

Muhammad starting running, until he saw a police car, which had arrived within minutes of the initial shots. Dyer said he dropped two necklaces he had been holding that he said were charms to ward off evil and gave himself up to police.

"I did it. I shot them," Muhammad told officers as they arrested him, according to the chief.

___

Associated Press writers Janie Har, Kristin Bender and Olga Rodriguez contributed to this story from San Francisco.