But passage of the bill is nonetheless a big success for House Republicans, who will now be able to go on a five-week recess having said they took action to secure the border and deal with a wave of child immigrants that have overwhelmed authorities.

Republicans during Friday’s debate repeatedly noted that they were in town legislating while the Democratic-run Senate had already left for the recess. The Senate failed to advance a larger $2.7 billion border bill on Thursday.

Republicans urged the Senate to come back and negotiate a compromise.

"The House is here working," said House Majority Whip Steve Scalise (R-La.). "I encourage the Senate to come back and do their job."

"If President Obama needs these resources, he will urge Senate Democrats to put politics aside, come back to work, and approve our bill," Boehner said. "There are also steps the president can take to address this crisis within the law, and without further legislative action. Every day the president and his party fail to act is another day this crisis continues.”

Passage fell largely along party lines in the 223-189 vote. Only four Republicans voted against the funding measure, while Rep. Henry Cuellar (Texas) was the only Democrat to support it.

Following passage of the border supplemental package, the House approved a second measure in a 216-192 vote that would prevent the Obama administration from expanding the Deferred Action for Child Arrivals (DACA) program. The program provides two-year work permits for undocumented immigrants who arrived to the U.S. as children before 2007.

"This just restores the constitutional authority of the United States Congress, and it says, President Obama, don't continue to violate the Constitution," King said.

The two votes come a day after the House GOP’s original $659 million border funding package was pulled from the floor after defections by conservatives.

Many Republicans were on their way out of town before rank-and-file members, particularly from the Texas delegation, pressured their leaders to call them back for a second try.

House GOP leaders then delayed the House recess, and renewed efforts to win over conservatives.

The new measure added $35 million to deploy National Guard troops to the border, a key provision that won over some members.

The strong showing from Republicans marked a strong comeback for the new leadership team. Majority Leader Kevin McCarthy (R-Calif.) and Scalise were both officially serving in their new roles for the first time today, after Rep. Eric Cantor (R-Va.) stepped down from his leadership post Thursday.

Both were clearly pleased to be able to shepherd the bill towards passage, just hours after they appeared ready to head home empty-handed. Members lined up to offer their congratulations to the two on the House floor after the bill passed. Scalise offered a fist-bump to Rep. Patrick McHenry (R-N.C.), his chief deputy whip.

“You’ve got to work it,” a smiling McHenry told a colleague as he exited the floor.

Scalise spread credit wide among his fellow Republicans for salvaging the border legislation.

"This was an important one for our team. You saw a very unified conference coming together, staying here to get our jobs done," he said. "I don't think anybody would have predicted 223 votes in favor of this bill. I think it was a great day for the House."

Like the previous legislation, the final bill also includes changes to a 2008 human trafficking law so that all unaccompanied minors from Central America undergo the same expedited repatriation process as children from Mexico.

"We were able to come to a point of 218 yes votes on what arguably is the most monumental vote that we will take in this entire term," Bachmann said on Friday. "And it's dealing with the issue that the American people care about more than any other, and that is stopping the invasion of illegal foreign nationals into our country."

Democrats accused the GOP of catering to its most conservative wing instead of working toward a bipartisan solution.

"Tonight will be a loss for rational humanitarian action and a victory for partisan negative policy. How sad. How wrong. How disappointing for the American people," said House Minority Whip Steny Hoyer (D-Md.).

Because the House and Senate are unlikely to reach a compromise over August, some federal agencies may run out of funding while lawmakers out of town. Immigration and Customs Enforcement is expected to encounter a shortfall in mid-August, with the same for Customs and Border Protection by mid-September.

"We have a crisis on our hands. And we can't simply get up and walk away," House Appropriations Committee Chairman Hal Rogers (R-Ky.) said Friday.

Republicans argue the 2008 law has handcuffed authorities, preventing them from quickly deporting young Central American immigrants back to their home countries. Authorities have the power to send young people from Mexico back to that country more quickly.

But Democrats largely opposed the measure due to concerns that changing the 2008 law would compromise due process for the child migrants. Rep. Ruben Hinojosa (D-Texas) warned that the legislation would cost Republicans votes from the Hispanic population in future elections.

"From attacks on young boys and girls to DREAMers, House Republicans continue to show their true colors when it comes to America's Latino community," said Hinojosa, the Congressional Hispanic Caucus chairman.

Republicans denied that they were targeting immigrants.

"I am not anti-immigrant. I am not anti-children," said Rep. Virginia Foxx (R-N.C.).

The border funding package includes $22 million to hire new temporary immigration judges and $197 million for the Department of Health and Human Services to house the unaccompanied minors.

Another provision in the bill would allow border patrol agents to access federal land within 100 miles of the Mexican border so that they can track down illegal immigrants.

Earlier Friday, President Obama pledged to "act alone" if Congress can't agree on a deal to provide funding for the border. He said he would veto the House measure that he argued was never intended to become law.

"This is a message bill that they couldn't quite pull off yesterday, so they made it a little more extreme so maybe they can pass it today - just so they can check a box before they’re leaving town for a month," Obama said.