LOS ANGELES -- California investigators have arrested and charged a man in connection with the shooting of two Los Angeles County sheriff's deputies earlier this month as they sat in their squad car, authorities said Wednesday.

Attempted murder charges were filed against Deonte Lee Murray, 36, District Attorney Jackie Lacey told reporters.

Murray was arrested two weeks ago in connection with a separate carjacking. He pleaded not guilty to charges in both cases during his arraignment Wednesday. He is being held in jail on $6.15 million bail and is due back in court in November.

Murray's attorney, Jack Brennan, declined to comment. Murray faces life in state prison if he is convicted.

Sheriff's Homicide Bureau Capt. Kent Wegener, who provided details about the investigation, did not suggest a specific motive for the attack “other than the fact that he obviously hates policemen and he wants them dead.”

Lacey described the shooting as “premeditated,” but she declined to say what led investigators to believe that.

The deputies suffered head wounds in the Sept. 12 ambush and have since been released from the hospital and are recovering. Sheriff Alex Villanueva said, however, that they face further reconstructive surgeries and that their recoveries will be a long process.

“We saw the worst of humanity” in the shooting, Villanueva said.

Surveillance video showed a person walking toward the patrol car, which was parked at a Metro rail station in the city of Compton, and firing a handgun through the passenger-side window. The deputies radioed for help despite their wounds.

The deputies, a 31-year-old woman and 24-year-old man graduated together from the sheriff's academy 14 months ago.

Investigators determined that the suspect fled in a black Mercedes Benz sedan and learned that type of vehicle was stolen in a Sept. 1 carjacking in which the driver was shot. A suspect was identified in the carjacking and photographs were compared to images from the ambush, strengthening a connection to the shooting of the deputies, Wegener said.

On Sept. 15, an investigator spotted the suspect driving another vehicle and attempted to stop him. A gun was thrown out before the suspect abandoned the car in the city of Lynwood. He ran off and was ultimately captured. The black Mercedes was found nearby.

That day, Villanueva told reporters the carjacking suspect was not related to the ambush case. He defended his actions that misled reporters, and the public, on Wednesday.

“We're not going to tell you everything we suspect,” the sheriff said, to protect the investigation.

Ballistics testing of the gun - a so-called ghost gun that is homemade and unregistered - discarded during the pursuit showed it was the one used in the attack on the deputies, Wegener said. He also noted that the gun held eight rounds, five short of its capacity, and that five rounds had been fired at the deputies.

Authorities said Murray, a Compton resident, has a criminal history including convictions for sales and possession of narcotics, firearm possession, receiving stolen property, burglary and terrorist threats. Wednesday's criminal complaint includes allegations that he associates with gangs.

The Los Angeles Times first reported Murray's arrest ahead of the news conference.

Compton is among communities near South Los Angeles, an area with a large Black population that has long been a flashpoint for racial tension and mistrust of police.

In recent weeks, demonstrators have marched to protest fatal shootings in the area, where deputies killed a Black man on Aug. 31 and a Black teenager in 2018.

After the ambush, a handful of protesters gathered outside the hospital where the deputies were treated and tried to block the emergency room entrance. Videos from the scene recorded protesters shouting expletives at police and at least one yelling “I hope they ... die.”

Wednesday's announcement of the arrest in the shooting of the deputies followed a separate, seemingly unprovoked assault on another law enforcement officer in Southern California.

A Los Angeles police officer was attacked Saturday night inside the Harbor Community police station in San Pedro.

The assailant was recorded on surveillance video as he knocked the officer to the ground inside the station, pistol-whipped him with his own gun and pointed it at his chest. The officer is recovering from his injuries.

--------

Correction: The summary of this story has been corrected to spell the district attorney's last name as Lacey, not Lacy.