Rep. Jared Polis (D-Colo.) first proposed language that would gut the 287(g) program completely, which would save $43.5 million. Polis's amendment would have taken 10 percent of that amount and used it to boost funding the Department of Homeland Security's civil rights division, and used the rest to cut the deficit.

"The 287(g) program has become increasingly controversial and increasing recognized as a costly failure," Polis said. "By allowing local police officers to effectively act as federal agents and immigration officials, it not only increases crime by taking cops off the beat, not only costs taxpayers money at a time where we have an over $600 billion deficit, but it also creates fear in the latino community and in the other immigration communities.

"In effect, it's trained local law enforcement officials to use racial profiling, asking community members where they're born or if they're in this country legally."

But Republicans disagreed and said the program is still needed to help tie federal and local immigration enforcements together.

"The robust enforcement of our nation's immigration laws is critical to our national security," said Rep. John Carter (R-Texas). "Currently, the 287(g) programs support that goal."

Carter said the ability of federal officials to work with state and local officials acts as a "force multiplier" that can be used to enforce immigration laws. He also said the program has identified more than 279,000 "potentially removable aliens."

In a Wednesday afternoon vote, Republican opposition was enough to kill Polis's amendment — the House rejected it in a 180-245 vote in which 16 Democrats voted with most Republicans.

Rep. Joe GarciaJoe GarciaFlorida Dems hosting fundraiser for GOP lawmaker Freshman Curbelo wins reelection in Fla. LGBT Republican groups campaigning for Curbelo in Fla. MORE (D-Fla.) proposed a separate amendment that would reallocate $10 million to U.S. Customs and Border Protection salaries — $3 million of that would come from the 287(g) program. Here again, Democrats argued that the program is "flawed," and called for support for the language.

But the House rejected this amendment as well, in a 186-236 vote.

Immigration also came up during debate on language in the bill that would require U.S. Immigration and Customs Enforcement (ICE) to maintain at least 34,000 "detention beds" to detain illegal immigrants. Democrats opposed this provision as one that gives ICE no flexibility for dealing with immigrants, and needlessly costs taxpayer money to maintain these beds.

"The bill once again sets an arbitrary minimum of 34,000 ICE detention beds, denying ICE the flexibility it needs to manage its enforcement and removal resources in response to changing circumstances," Rep. David Price (D-N.C.) said.

Rep. Ted Deutch (D-Fla.) proposed an amendment to strike language requiring ICE to maintain any minimum number of detention beds. Deutch said ICE interprets the requirement to mean that ICE must hold a yearly average daily population of 34,000 detainees, and said no other part of the government is given instructions to hold a certain amount of detainees.

Nonetheless, the House killed this amendment in a 190-232 vote.

These immigration-related were just some of the amendments the House considered to the DHS spending bill on Wednesday. Details follow here on other amendment results from:

Gwen MooreGwen MooreKamala Harris eyed on the dance floor at DC event House considers harsher rules for banks with North Korean ties Black lawmakers launch ‘root out racism’ campaign vs. Trump MORE (D-Wis.), restoring full funding for the DHS Office of Civil Rights and Civil Liberties by reallocating $3.4 million. Failed 167-257.

Dave ReichertDavid ReichertJuan Williams: Momentum builds against gerrymandering GOP worries as state Dems outperform in special elections Targeted Republicans push back on retirement speculation MORE (R-Wash.), increasing funding for the U.S. Fire Administration by $1.8 million, by cutting the operational account at DHS. Passed in voice vote.

Ted PoeTed PoeA bipartisan solution to stopping drive-by lawsuits Harvey response puts squeeze on GOP US Senate must follow House lead in combating human trafficking MORE (R-Texas), adding $10 million to a fund expanding cell phone service on the border. Passed in voice vote.

— Joe Heck (R-Nev.), fully funding the Urban Area Security Initiative by reallocating $22 million. Failed 156-268.

— Jon Runyan (R-N.J.), boosting firefighter programs by $2.5 million. Passed in voice vote.

— Michael Grimm (R-N.Y.), reallocating $7.6 million in funding for the National Urban Search and Response System. Passed in voice vote.

— Stephen Lynch (D-Mass.), reallocating $15.6 million to fund DHS's Surface Transportation Security program. Passed in voice vote.

— Scott Tipton (R-Colo.), reallocating $7.6 million for wildfire prevention efforts. Passed in voice vote.

— Tipton, cutting $4 million from TSA and giving $3 million of it to small and rural airports for technology upgrades. Passed in voice vote.

— Richard Hudson (R-N.C.), reallocating $12.5 million to the Federal Flight Deck Officer program, which trains volunteer pilots to carry firearms during flights. Passed in voice vote.

— Brownley (D-Calif.), reallocating $97.5 million to the Port Security Grant Program. Passed in voice vote.

— Eric Swalwell (D-Calif.), requiring that at least $97.5 million of Federal Emergency Management Agency grants would be used for mass transit security. Passed in voice vote.