About 4:50 a.m., two males approached the vehicle in the 300 block of Winchester Avenue and one of them opened fire multiple times before they fled the scene, the Rialto Police Department said in a statement.
Officers responded to the location and found the man in the driver's seat of the car, suffering from a gunshot wound to his head. Paramedics were summoned to the scene, where the victim was subsequently pronounced dead.
The man was later identified my family members as 27-year-old Jonathan Benitez.
The investigation took a twist when the victim's best friend was arrested. Authorities said he was taken in on unrelated charges, but investigators said they were questioning him about Benitez's murder.
As police led him away in handcuffs, he was asked if he had anything to do with the murder. He shook his head and said no.
Police said they're holding the man, identified by friends only as Jasper, to question him about the murder of his best friend, Benitez.
Benitez's ex-girlfriend, with whom he shares a daughter, said Benitez had known Jasper for two years and that the two met while serving time in jail together.
The crime was being investigated as an apparently botched robbery, authorities said. A section of Winchester remained closed Thursday afternoon as Rialto police detectives examined the vehicle and collected evidence.
"I heard a gunshot go off and I was lying there and through my window I could hear people running and talking and moments later I looked out my window and I saw a newer white, I'm not sure if it was a (Toyota) Camry, but it flew by," a neighbor, who asked to remain anonymous, told Eyewitness News.
A nearby surveillance camera may have recorded video of the incident, according to police. Descriptions of the two suspects were not available.
Anyone with information about the incident was urged to call Rialto police Detective Ralph Ballew at (909) 820-8055.