Lawyers for the American Civil Liberties Union sued the Palmer Police Department on Thursday, saying three officers made a false arrest by holding a man behind bars solely because of his immigration status.

The case, which also names a police dispatcher, wades into a national debate over local-versus-federal immigration priorities and aims to set a precedent in Alaska.

It began when police were called early on the morning of Aug. 27 to a bar fight in which, the ACLU says, the man was beaten and bloodied.

"The hope is that when crime victims, who often are immigrants, call the police, the police will come to help and not to arrest," said Casey Reynolds, spokesman for the ACLU of Alaska.

The ACLU says Alex Caceda, 38, had been working at Klondike Mike's Saloon in Palmer when a bouncer attempted to throw out three men involved in a confrontation with a bartender who had just finished her shift.

Caceda was attempting to come to the aid of the bartender and was beaten in the melee, the attorneys say. When Palmer police arrived to sort things out, a wounded Caceda thought they wanted to talk to him because he was the victim of an attack, according to the lawsuit.

Instead, Caceda left in handcuffs. Police reports obtained by the ACLU in the case say officers determined that Caceda was living in the United States illegally.

"Caceda was an illegal alien and had a U.S. Immigration Detainer warrant for his arrest," wrote Palmer police officer Jamie Hammons. "I confirmed the warrant was active and arrested Caceda."

Caceda is from Peru and was living in the United States illegally, having overstayed a non-immigrant visa by several years, according to a U.S. Immigration and Customs Enforcement spokeswoman. Court records show he has no apparent criminal history in Alaska.

It's unclear how long he has lived in the state.

Questions to the city of Palmer were directed to the city manager, who said he could not comment on ongoing litigation. An attorney representing the city, Michael Gatti, said he has received the complaint and was reviewing it.

Palmer police reports describe Caceda as a cook for Klondike Mike's Saloon. The lawsuit says Caceda lives in Palmer with his wife.

"Although he was undocumented at the time of this incident … (he) is currently applying for an immigration visa as a spouse of a U.S. citizen (IR1), which will make him eligible for a green card," the complaint says.

The lawsuit argues that the arrest violated the searches and seizures clause of the Alaska Constitution. The complaint calls for a Superior Court judge to declare that Palmer police have no authority to make arrests and detain people for civil immigration violations — even when requested to do so by federal immigration officers.

It also calls for monetary damages "for his assault, false arrest and false imprisonment."

Caceda was not charged with a crime related to the bar fight, and the ACLU says the men who beat him were never prosecuted.

"We want the vulnerable communities in Alaska to know that they can call on the police for protection and not have to be worried about being ripped out of their lives and taken away because federal immigration law is being enforced," said Reynolds, the ACLU of Alaska spokesman.

Caceda was treated for his injuries and held at the Mat-Su Pretrial Facility where a waiting Homeland Security Investigations agent arrested him, according to ICE spokeswoman Carissa Cutrell.

A spokeswoman for the agency said that, in general, detainer warrants like the one cited in the Palmer police report are requests by the federal government to hold an unauthorized immigrant who is already in local police custody. In this case, Caceda was not the suspect in any local crime and was taken into custody at ICE's request.

The ACLU posted a video online showing body camera footage captured by the Palmer officers, including moments before and apparently after the arrest. Blood can be seen covering Caceda's scalp. He tells police he was "protecting the girl that got her nose broken."

"You are arresting me? Why?" Caceda asks at one point, according to edited police footage provided by the ACLU.

"Even if you didn't commit a crime, it's something the Department of Homeland Security wants. Its not us. It's a federal thing," he is told while riding in a patrol car, according to the video.

Caceda says that his wife will be upset at the way he is being treated by police. "I don't have a choice, this is the federal government wanting you arrested," an officer replies. "Not me."

"You're considered a criminal in the United States right now," she says.

With Caceda as the plaintiff and officer Hammons, the city of Palmer and other police department employees named as the defendants, ACLU attorneys filed the lawsuit in Alaska Superior Court.

The complaint cites a January 2017 executive order by President Donald Trump that expanded who the federal government considers a priority for deportation. The National Immigration Law Center has said the order encourages racial profiling by law enforcement and, under the Department of Homeland Security interpretation, makes almost any immigrant a target for deportation regardless of their criminal record.