A man brutally beaten by police in June after he surrendered and lay down on the ground is now at risk of being deported.

Police officers in Santa Ana, California, beat Edgar Vargas Arzate on June 20, according to surveillance video of the incident and interviews with Arzate's attorney. Arzate, who has struggled with addiction and mental health issues, went to visit the house of a friend, apparently not realizing that the friend no longer lived there, according to his attorney, public defender Frank Bittar. The new residents saw Arzate mumbling incoherently outside their house and called police.

Arzate ran when he saw the officers, leading them on a roughly four-block chase before he surrendered in the front yard of a neighbor's home, Bittar said. In the video, Arzate can be seen lying facedown on the ground. The officers then begin to savagely beat Arzate, punching, kicking and swinging a flashlight at him.

In the video, two officers on the opposite side of the fence look up and appear to notice the surveillance camera, then say something to the officers beating Arzate, who quickly move him out of view of the camera.

"He's lucky he wasn't put in a wheelchair," Bittar told HuffPost.

Once he was taken into custody, Arzate was charged with assaulting a police officer. The charge was then enhanced to a higher-level felony when police accused him of having "personally inflicted great bodily injury" on one particular officer who claimed to have broken his hand, according to the charging document.

On Monday, Arzate, 27, who came to the U.S. without documentation as a teenager, was riding with family members to a preliminary hearing to face the charges. Suddenly, three unmarked cars pulled the family over and Arzate was quickly taken into custody by Immigration and Customs Enforcement agents.

"They stopped them and made everyone get out of the car and then arrested my brother," said Araceli Vargas, Arzate's younger sister. "Right now he's under immigration hold and we're just waiting on a bail so we can get him out of jail again. I don't know what's going to happen next, honestly."

"My mom told me that the ICE agents made her feel less than human," Vargas continued. "My dad was so disappointed in the system. My grandpa was so scared, he's been in bed since. My aunt started crying. Nothing had happened since June, he was just living his normal life, but we have cameras here and we saw the cars that stopped my brother yesterday morning -- it was a gray Chevy Impala -- they didn't have markings, but they had been spying on us. They passed by the house at least four times that morning, so they knew what they were doing. Why did they wait until we were leaving the house and going to court?"

Bittar instantly suspected that local police had tipped off the federal government to get Arzate out of the country. "This is so highly bizarre," he said in a telephone interview just after learning of Arzate's apprehension. "The feds would never have done this if somebody hadn't tipped him off."

Corporal Anthony Bertagna of the Santa Ana Police Department told HuffPost that ICE acted on its own. "We don't tip off ICE. We didn't know he had a court date," he said. "Last I heard, he was still in custody. Obviously if we wanted him arrested we'd arrest him ourselves. When it comes to ICE and their jurisdiction and the laws they enforce, when we're asked to assist, we assist. We were not involved in ICE's action."

Bertagna told The Voice of OC, a nonprofit investigative site that covers Santa Ana, that it was unusual for ICE to use unmarked cars to apprehend someone. “I’ve never heard of ICE making car stops like that before,” he said.

An ICE official said that once the agency learned about Arzate's beating, they decided not to fast-track his deportation. "Mr. Vargas was targeted for arrest Aug. 18 by officers assigned to U.S. Immigration and Customs Enforcement’s (ICE) Criminal Alien Program based solely upon his case history, which includes two prior deportations and multiple felony convictions," said ICE spokeswoman Virginia Kice.

"At the time of Monday’s arrest, ICE officers were unaware of Mr. Vargas’ involvement in a high-profile investigation," Kice said. "Once ICE became aware of the matter, the agency elected to place Mr. Vargas in immigration proceedings, rather than reinstating his prior removal order and repatriating him to Mexico immediately. The action will afford Mr. Vargas and his legal representatives additional time to pursue his case in immigration court and address the other outstanding issues stemming from his recent criminal arrest."

Arzate, despite having been brought to the country as a teenager, is not eligible to apply for deferment under the immigration program known as Deferred Action For Childhood Arrivals, because he has previously been imprisoned on drug and auto theft charges. He has twice before been deported and re-entered the U.S. "Everyone he knows is here," Bittar said.

Bittar's case is an example of how people in the United States without documentation face a parallel justice system. Americans who have previously been convicted of crimes retain basic civil and constitutional rights, but undocumented immigrants are not granted those basic protections.

ICE's policy is to give leniency to victims of a crime, often granting them what's known as a U Visa. "Absent special circumstances or aggravating factors, it is against U.S. Immigration and Customs Enforcement (ICE) policy to initiate removal proceedings against an individual known to be the immediate victim or witness to a crime," the agency says.

If Arzate had been assaulted by a group other than law enforcement, his immigration situation would likely be improved. In order to obtain a U Visa, law enforcement must certify that you are, in fact, a victim who can be helpful in the prosecution of the perpetrators. But if law enforcement officials are themselves the perpetrators, the likelihood they will certify the victim drops close to zero.

Arzate's only hope, Bittar said, may be for the Department of Justice to launch its own investigation and certify Arzate.

The move against Arzate comes at a tense moment for Los Angeles. In August, L.A. police shot and killed an unarmed man, Ezell Ford, and have yet to release the autopsy or the names of the officers involved. Also this month, police beat and killed another unarmed man, Omar Abrego.

Elise Foley contributed reporting, and Matt Ferner contributed from Los Angeles.