WASHINGTON (AP) — Politically freighted border security negotiations are teetering just days before a potential new government shutdown. The turmoil is testing the changed balance of power in Washington, with lawmakers engaged in a sparring match over immigration policy that is challenging their ability to reach any accord.

Republicans say Democratic demands to limit immigrant detentions by federal authorities are a deal breaker — eclipsing the border wall issue for now — and represent overreach by top Democrats like House Speaker Nancy Pelosi of California.

The two sides also remained separated over how much to spend on President Donald Trump's promised border wall. A Friday midnight deadline is looming to prevent a second partial government shutdown.

Lawmakers hoped to get the talks back on track at a meeting on Monday afternoon.

Rep. Kay Granger of Texas, one of the Republican negotiators, gave an optimistic assessment. She said the talks are in "better shape today" and expressed optimism about reaching a deal before the deadline.

The plan is to keep pushing for a deal, in part because the underlying spending measure funds a bevy of Cabinet departments and represents months of work on Capitol Hill. A collapse of the negotiations could imperil budget talks going forward that are required to prevent steep spending cuts to the Pentagon and domestic agencies.

But the negotiations hit a rough patch Sunday amid a dispute over curbing Immigration and Customs Enforcement, or ICE, the federal agency that Republicans see as an emblem of tough immigration policies and Democrats accuse of often going too far.

Trump blamed Democrats in the migrant detention dispute, tweeting, "The Democrats do not want us to detain, or send back, criminal aliens! This is a brand new demand. Crazy!"

Trump met Monday afternoon with top advisers in the Oval Office to discuss the negotiations before heading to Texas for a rally.

The fight over ICE detentions goes to the core of each party's view on immigration. Republicans favor rigid enforcement of immigration laws and have little interest in easing them if Democrats refuse to fund the Mexican border wall. Democrats despise the proposed wall and, in return for border security funds, want to curb what they see as unnecessarily harsh enforcement by ICE.

People involved in the talks say Democrats have proposed limiting the number of immigrants here illegally who are caught inside the U.S. — not at the border — that the agency can detain. Republicans say they don't want that cap to apply to immigrants caught committing crimes, but Democrats do.

"ICE is being asked to ignore the laws that Congress has already passed," said ICE Deputy Director Matt Albence on a media call organized by the White House. "It will be extremely damaging to the public safety of this country. If we are forced to live within a cap based on interior arrests we will immediately be forced to release criminal aliens that are currently sitting in our custody."

Democrats say they proposed their cap to force ICE to concentrate its internal enforcement efforts on dangerous immigrants, not those who lack legal authority to be in the country but are productive and otherwise pose no threat. Democrats have proposed reducing the current number of beds ICE uses to detain immigrants here illegally from 40,520 to 35,520.

But within that limit, they've also proposed limiting to 16,500 the number for immigrants here illegally caught within the U.S., including criminals. Republicans want no caps on the number of immigrants who've committed crimes who can be held by ICE. Senate Majority Leader Mitch McConnell called the proposed limits on detention beds "absurd."

Acting White House chief of staff Mick Mulvaney, in appearances on NBC's "Meet the Press" and "Fox News Sunday," said "you absolutely cannot" eliminate the possibility of another shutdown if a deal is not reached over the wall and other border matters. The White House had asked for $5.7 billion, a figure rejected by the Democratic-controlled House.

But Mulvaney did signal that the White House would prefer not to have a repeat of the last shutdown, which stretched more than a month, left more than 800,000 government workers without paychecks, forced a postponement of the State of the Union address and sent Trump's poll numbers tumbling. As support in his own party began to splinter, Trump surrendered after the shutdown hit 35 days without getting money for the wall.

The president's supporters have suggested that Trump could use executive powers to divert money from the federal budget for wall construction, though it was unclear if he would face challenges in Congress or the courts. One provision of the law lets the Defense Department provide support for counterdrug activities.

But declaring a national emergency remained an option, Mulvaney said, even though many in the administration have cooled on the prospect. A number of powerful Republicans, including Senate Majority Leader Mitch McConnell, R-Ky., have also warned against the move, believing it usurps power from Congress and could set a precedent for a future Democratic president to declare an emergency for a liberal political cause.

House Budget Committee Chairman John Yarmuth, D-Ky., countered by saying on the same show, "The numbers are all over the place."

"I think the big problem here is this has become pretty much an ego negotiation," Yarmuth added. "And this really isn't over substance."

___

Associated Press writers Catherine Lucey, Hope Yen, Andrew Taylor and Lisa Mascaro in Washington and Julie Walker in New York contributed to this report.

Online Public Information File

Viewers with disabilities can get assistance accessing this station's FCC Public Inspection File by contacting the station with the information listed below. Questions or concerns relating to the accessibility of the FCC's online public file system should be directed to the FCC at 888-225-5322, 888-835-5322 (TTY), or fccinfo@fcc.gov.