Updated

Deonte Lee Murray, the man accused in the ambush shooting of two Los Angeles County deputies in Compton earlier this month, has been charged with attempted murder, prosecutors announced Wednesday.

Murray, 36, was taken into custody after a lengthy standoff three days after the deputies were shot, though his arrest was unrelated to the attack on the deputies, Sheriff Alex Villanueva initially said.

COMPTON 'AMBUSH' LEAVES 2 LA COUNTY SHERIFF'S DEPUTIES 'FIGHTING FOR THEIR LIVES'

The deputies, a 31-year-old woman and a 24-year-old man, were shot in the face and head while sitting in their patrol car near the Compton metro station. Both underwent surgery and have been released from the hospital. They are expected to make a full recovery.

At the time of his arrest, Murray, who has suspected gang ties, was charged with one felony count each of carjacking, second-degree robbery, and assault with a semiautomatic firearm - personal use of a firearm. The charges also included allegations of association with a criminal street gang, discharging a rifle inflicting great bodily injury, and personal use of an AR-15.

The deputy shooting was captured on surveillance video and shows a person in dark clothes walking up the pathway near Compton's Blue Line station and approaching the parked patrol car from behind. The person in the video is seen coming closer to the car and then can be seen facing the passenger door of the patrol SUV. Then, just inches from the window, the person is caught on video raising a gun, opening fire, and running back the way he came.

Soon thereafter, the passenger door of the SUV opens and a deputy stumbles out, with a hand on their head. The driver's side door then opens. One of the wounded deputies says, "Compton Pax, deputies down."

The female deputy then managed to help her partner out of the cruiser and hide behind a concrete pillar for safety. She applied a tourniquet to her partner's arm to help stop the bleeding.

"They became victims of a violent crime for one reason - they were doing their job and they were wearing a badge," LA County District Attorney Jackie Lacey said Wednesday. Lacey added that the charges could be amended if there is evidence that the attack was done to benefit a gang.

CLICK HERE FOR THE FOX NEWS APP

Villanueva believes the hatred toward police officers is growing and that there are "people who have such deep-seated hatred against law enforcement that they're just willing to kill anybody unprovoked."

Dallas Mavericks owner Mark Cuban has reportedly donated $50,000 to each of the Compton deputies.