Tensions flare over immigration enforcement between local police, Trump's DHS At issue was Trump administration's combative stance toward "sanctuary cities."

 -- The Trump administration's stance toward "sanctuary cities" is increasingly angering state and local police in those areas, and tensions reached a boiling point during a recent meeting in Washington of local law enforcement and Homeland Security officials, sources told ABC News.

A particular source of disagreement is over federal officials’ insistence that local police detain unauthorized immigrants beyond their sentences until immigration agents can pick them up for deportation -- a move that some law enforcement officials argue is illegal.

When a senior Homeland Security official asserted at Thursday’s meeting that local police can legally hold onto unauthorized immigrants until Immigration and Customs Enforcement (ICE) agents come by, police officials shot back: "Under what authority?," sources told ABC News.

"I hoped that last Thursday's meeting would change things, but they didn't," a source who was at the meeting in Washington told ABC News. "It was evident that [Department of Homeland Security officials] were less interested in finding a solution as opposed to wanting to dig in their heels."

A Homeland Security spokesman disputed that view, saying that although the meeting had some “areas of disagreement … it was a productive exchange.”

The meeting came as President Trump’s crackdown on illegal immigration includes an openly combative approach toward cities and counties that declare themselves “sanctuary cities,” a term that often generally refers to a decision to refrain from having local police act as immigration agents.

White House press secretary Sean Spicer on Friday slammed the "so-called sanctuary cities" that he said "flout" ICE detention requests. Such cities "have prioritized a political agenda over the safety of their people," allowing criminals "to roam the streets," he said.

Days earlier, Attorney General Jeff Sessions warned "sanctuary cities" that they could lose federal funding if they fail to meet ICE detainer requests.

Last month, Homeland Security officials started to single out locales, releasing weekly reports identifying the "sanctuary cities" and other jurisdictions that have declined ICE requests to prolong the detention of unauthorized immigrants.

Police officials at Thursday’s meeting expressed particular frustration over those new reports, denouncing them as "grossly" inaccurate "tattle lists," sources told ABC News.

The meeting included representatives of the International Association of Chiefs of Police, the Major Cities Chiefs Association, the Major County Sheriffs' Association, and the National Sheriffs Association.

Local law enforcement officials at the meeting also stressed their belief that the law prohibits them from prolonging the detention of unauthorized immigrants unless there is a court order. Recent cases show that such continued detention can open police agencies up to lawsuits.

In what one source described as "the most heated" moment of the meeting, a Republican sheriff from Minnesota sternly questioned why his department was named in a report two weeks ago accusing Hennepin County of releasing two criminals back onto the streets.

Hennepin County Sheriff Rich Stanek pulled out photos of ICE agents taking the two criminals into custody – proof, he told a senior DHS official, that the weekly reports are inaccurate, sources said.

Another issue for local police is that even when they comply with an ICE request to hold unauthorized immigrants longer, federal agents don't always show up to take custody of the detainees.

Homeland Security officials say that's because local jurisdictions fail to give them sufficient notice when unauthorized immigrants are due to be released.

A DHS official conceded that Thursday's meeting was "contentious" at times, but said the gathering was always expected to include an airing of differences.

"While the discussion did involve areas of disagreement regarding ICE detainers, DHS representatives believe it was a productive exchange of information that will help strengthen DHS partnership with local law enforcement," spokesman Dave Lapan said in a statement to ABC News.

Sheriff Greg Champagne of St. Charles, Louisiana,who attended the meeting as president of the National Sheriffs Association, agreed. He said that while there were “points of contention,” the meeting was productive and not “some kind of hostile food fight.”

The most senior DHS official in attendance, Acting Deputy Secretary Chip Fulghum, opened the meeting by noting his department's "interest in working together to find solutions," according to Lapan, who said cooperation was "a repeated theme throughout the roundtable discussion."

Within minutes, though, tensions flared inside the room, as Fulghum defended the weekly reports issued by his department, sources said.

"A few specific cases and situations were raised during the meeting and Mr. Fulghum asked DHS staff to work with the attendees to get additional information," Lapan said.

Much of the meeting focused on whether it would violate local, state and even federal law for cities and counties to comply with ICE detainer requests.

Unauthorized immigrants who have committed crimes "need to be dealt with and need to go," but "everybody in this country, no matter how you got here, has constitutional rights," one source who was in Thursday's meeting noted.

"Every court" has said, "’You're going to be sued and you’re going to be liable,’” if you violate the rights of even unauthorized immigrants, the source added.

Several years ago local law enforcement agencies may have more readily complied with ICE detainer requests. But in 2014, at least two federal courts – on opposite sides of the country -- ruled in separate cases that the constitutional rights of unauthorized immigrants arrested on criminal charges were violated when police complied with ICE requests for further detention.

Republican Sheriff Robert Gualtieri of Pinellas County, Florida, pressed Homeland Security officials at the meeting to name even one court that has ruled in favor of their stance, according to a source.

"They tap-danced around that and they acknowledged there isn't one," the source said.

Sheriff Champage acknowledged that “there is a lot of gray area about that.” But he said supporters of illegal immigrants have “cherry picked” locations for legal cases, filing lawsuits in liberal-leaning jurisdictions where they expect to get favorable rulings.

When DHS announced its new weekly reports, it acknowledged that some "state or local laws, ordinances, or policies restrict or prohibit cooperation with ICE." But DHS also asserted that some locations "choose to willfully decline ICE detainers and release criminals back into the community."

Apart from legal questions around prolonged detention is the concern among police that complying with certain ICE requests could undermine their ability to protect public safety, a former DHS official, John Cohen, warned.

"The problem is if [police] comply with what the administration is calling for, they potentially undermine the trust and collaboration needed to stop gang violence and other crime within [immigrant] communities," said Cohen, an ABC News contributor who also served several years as a police officer in California.

"The balance for law enforcement is working with ICE to go after violent criminals -- and at the same time maintaining a trusted partnership with immigrant communities," he said.

Police officials have suggested one possible solution: ICE could ask judges to issues orders of detention or otherwise sign off on detainer requests. That would address many jurisdictions' concerns over lawfulness and liability.

But a DHS official told ABC News that requiring the "extra step" of seeking judges' approval would further burden an "already overburdened court system," and federal authorities believe their requests are legal even without a judge's signature.

At Thursday's meeting, Fulghum of DHS "asked for ideas on how DHS can accomplish its mission to ensure our communities are safe while addressing law enforcement's concerns about honoring certain detainer requests," a source said.

As for navigating laws across the country, Sheriff Champagne said he’s “hoping for guidance from the courts to let us do our jobs.”

He said “we would love to have” a ruling from the U.S. Supreme Court, which would establish a “gold standard” for state and local law enforcement agencies to follow.