A U.S. Border Patrol agent searches an undocumented migrant who illegally crossed the Rio Grande in Los Ebanos, Texas, April 6, 2019.

The House on Tuesday passed a bill to send emergency aid to the southern border, setting up another face off with the White House and Senate Republicans over immigration policy.

The Democratic-held chamber approved $4.5 billion to manage an influx of migrants after leaders changed the measure to appease liberals' concerned about the Trump administration's treatment of migrant children. The party added health and safety standards for the government to follow as furor grows about living conditions for hundreds of children who were held at a Texas facility.

It passed in a 230-195 vote, mostly on party lines. Four Democrats opposed the measure, while three Republicans backed it.

The GOP-held Senate will likely try to pass its own version of the border aid bill before lawmakers leave town Thursday for their July 4 recess. It is unclear how quickly the two chambers may agree on a bill they can both pass. Democrats have hesitated to give President Donald Trump funds for his immigration policy — or anything he can cast as a political victory on the issue.

The scramble to send money to the border comes at a tumultuous time for U.S. immigration policy. Lawmakers have slammed the treatment of children at a migrant detention facility in Texas, where an Associated Press report depicted malnutrition, poor sanitary standards and older children tasked with looking after a toddler.

Earlier Tuesday, acting Customs and Border Protection Commissioner John Sanders resigned, effective July 5. Meanwhile, Trump has threatened mass deportations starting two weeks from Sunday if Democrats do not agree to changes to asylum laws.

Democratic leaders tied the bill to efforts to oppose Trump's broader immigration agenda. In a statement shared by the House Appropriations Committee, House Speaker Nancy Pelosi, D-Ca., said "a vote for this bill today is a vote against the Trump Administration's cruel attitude towards children."

"It creates strong oversight by Congress so we can ensure this crisis never occurs again," she said.

House Appropriations tweet: From @SpeakerPelosi on @HouseDemocrats' emergency border supplemental bill: "A vote for this bill today is a vote against the Trump Administration's cruel attitude towards children. It creates strong oversight by Congress so we can ensure this crisis never occurs again."

A separate, bipartisan bill passed by the Senate Appropriations Committee would put $4.6 billion toward border funding without the conditions imposed in the House bill. Still, the White House has threatened to veto both measures because they do not include money for more Immigration and Customs Enforcement detention beds.

House Minority Leader Kevin McCarthy, R-Ca., has accused Pelosi of "playing politics" and urged her to take up the Senate version of the legislation.

Subscribe to CNBC on YouTube.