Protesters against the Texas state law to punish "sanctuary cities" stands outside the U.S. Federal court in San Antonio, Texas. (Staff/Reuters)

Texas’s tough new sanctuary-city law was debated in federal court on Monday, with lawyers for several Texas cities calling it draconian and unconstitutional and attorneys representing the state and the Trump administration saying it makes sense to compel jurisdictions to work with federal immigration agents.

Led by the small border city of El Cenizo, the plaintiffs urged U.S. District Judge Orlando Garcia to halt the law before it takes effect Sept. 1, saying it violates the Constitution, could hammer the state economically and illegally targets Latinos. One lawyer called the law a “constitutional train wreck.”

But lawyers for Texas and the Justice Department rejected those arguments and said the state has the right to create a uniform immigration policy instead of a hodgepodge of standards that can vary by town.

Now the state has one policy: Cooperate with deportation agents.

“We are not going to stand in their way,” said Brantley D. Starr, deputy first assistant attorney general for the state.

El Cenizo Mayor Raul Reyes, center, leaves the U.S. Federal Court during a break in a hearing over a new Texas "sanctuary cities" bill that aligns with the president's tougher stance on illegal immigration. (Eric Gay/AP)

The day-long hearing launched a contentious legal battle over a statute that has roiled state politics in recent months and led to a scuffle on the floor of the state house in Austin in May.

On Monday, busloads of people arrived in San Antonio, which is 60 percent Latino, and rallied outside the courthouse in 93-degree heat, holding signs and chanting “Sí, se puede” (Yes, we can).

In the courtroom, the American Civil Liberties Union and others argued that the law attempts to conscript local police to help carry out mass deportations at the behest of the federal government — or face stiff penalties if they don’t.

Local officials who refuse to cooperate with deportation efforts could lose their jobs, police chiefs could go to jail, and agencies face stiff fines of up to $25,500 a day.

“They are setting up a situation that incentivizes people to enforce immigration law to the maximum,” said Lee Gelernt, a lawyer for the ACLU arguing on behalf of El Cenizo.

Texas said in court filings that the law doesn’t require police officers to initiate immigration interrogations or arrests. Rather, it asks police and jailers to cooperate with U.S. Immigration and Customs Enforcement (ICE) in the same way that they do with other law enforcement agencies.

Lawyers defending the statute also said it includes provisions to protect crime victims and witnesses who are immigrants, and who critics say will be less likely to work with local law enforcement if those officers are compelled to cooperate with deportation agents.

The Trump administration has praised Texas’s law and said it bolsters the president’s plans, laid out in a Jan. 25 executive order, to dramatically ramp up immigration enforcement.

Erez Reuveni, senior litigation counsel at the Justice Department, said in court Monday that federal law does not require cooperation with immigration officials — but state law can. He said federal officials have invited states to assist in immigration enforcement, and Texas accepted that overture.

Several states have expressed support for the Trump administration’s crackdown on undocumented immigrants, and some have banned “sanctuary cities” that refuse to cooperate with ICE.

But hundreds of cities, towns and law enforcement agencies nationwide have enacted policies to protect immigrants from deportation, particularly those detained for minor offenses.

In Texas, even some cities that do not consider themselves sanctuary cities and that cooperate with ICE have condemned the law as vague and financially burdensome and potentially dangerous to police officers.

Dallas City Attorney Charles Estee said city police, who are still mourning a fatal attack on several officers last year, are worried that having officers closely associated with immigration agents would alienate the community. Houston and San Antonio also have expressed concern that the new law will make immigrants less likely to report crime. In addition, critics say the status could lead to racial profiling, which attorneys for the state point out is already banned by Texas law.

Gov. Greg Abbott (R) has said he signed the law in May to promote public safety. He and his supporters have cited cases in which undocumented immigrants allegedly committed major crimes, including murder, after they were released instead of being turned over to immigration officials.

“They were acting to protect public safety,” Starr said in court.

But El Paso County Attorney Jo Anne Bernal said in court that the legislation “creates, frankly, a less safe community.” Affidavits filed in the lawsuit say domestic violence victims in El Paso tried to rescind protective orders after learning that immigration agents had detained a transgender woman who was seeking protection from an ex-boyfriend at the courthouse in February.

State Rep. Ana Hernandez (D) wept on the stand as she described how the emotionally charged debate over the bill reminded her of her own days as an undocumented immigrant.

She later became a U.S. citizen, graduated from law school and was elected to state office in Houston, representing parts of the city and surrounding areas. She said many others targeted by the state law are just like her.

“I am the undocumented immigrant,” she said.

Some cities in Texas say the law, if upheld, could prompt sports organizations and others to boycott the state, similar to the effect of a controversial bathroom bill in North Carolina.

The American Immigration Lawyers Association has moved its 2018 conference from Grapevine, Tex., to San Francisco because of the law.