John Boehner

House Speaker John A. Boehner of Ohio departs a closed-door meeting of House Republicans, where the border crisis was discussed. The House finally passed a bill, largely on a party-line vote. (J. Scott Applewhite / Associated Press / August 1, 2014)

House Republicans went overtime Friday, expending an enormous amount of political energy to try to reach consensus on a border-crisis measure that is almost certain never to become law.

The last-minute push came as lawmakers were about to head into a five-week summer break with little to show constituents for their efforts to respond to the humanitarian crisis along the Southwestern border — a reminder of why congressional approval ratings are at all-time lows.

After a Friday night session, the House approved, 223 to 189, a $694-million emergency border package on a largely party-line vote. Loath to go home having done so little on an issue that has roused partisan passions, lawmakers also approved a bill to end a White House program that gives temporary legal status to many young immigrants brought illegally to the U.S. as children.

But the tangle over the border legislation gave President Obama another opportunity to complain that even when he tries to work with the legislative branch, Republican-on-Republican infighting gets in the way.

“They're not even trying to actually solve the problem,” Obama said during an afternoon news conference as House GOP leaders struggled to muster votes for a package to provide emergency funding. “That means while they're out on vacation I'm going to have to make some tough choices to meet the challenge — with or without Congress.”

But to win over the conservative wing of his party, House Speaker John A. Boehner (R-Ohio) adopted a tougher approach toward immigrants and threw in $35 million to compensate states — namely, Republican-led Texas — that have dispatched the National Guard to the border.

While Friday night's success in the House may mark a political achievement for the GOP, it won't do much to resolve the emergency because, like so much of the work in Congress these days, the House and Senate are moving in opposite directions. Democrats in the Senate oppose the GOP approach, and left town Thursday, unable to pass their own bill over Republican objections.

Instead, what won approval in Congress in the final days were scaled-down versions of must-pass legislation — the bare basics needed to avert a deeper crisis and keep the lights on for the routine business of government.

For example, lawmakers sent a $16.3-billion VA reform bill to the president, but only after whistle-blowers had exposed a series of problems at Veterans Affairs medical facilities that produced excessive wait times for care.

Sorely needed federal highway funding was extended to avoid the prospect of road projects being disrupted across the nation. But Congress could agree to only a 10-month patch, far from the sweeping infrastructure investment experts say is needed to bolster the economy and repair the nation's neglected roads and bridges.

“Temporary fixes are not enough,” said Peter McLaughlin, a county commissioner in Hennepin, Minn., and the chairman of the transportation committee at the National Assn. of Counties. “Counties are doing everything we can, and we urge our partners on the Hill to stop kicking the can down the road.”

On nonemergency items, little progress was made on most of Congress' to-do list, including a bill to curtail National Security Agency spying on Americans and a renewal of the Export-Import Bank, which major U.S. manufacturers say is vital to staying competitive in the global economy.

Even approval of the new U.S. ambassador to Russia was temporarily stalled late Thursday in a partisan Senate dispute before cooler heads prevailed.

“This is chaos none of us have ever seen before,” said Rep. Jim McDermott (D-Wash.), who was a state legislator before coming to Congress more than 25 years ago.

Part of the problem is the upcoming midterm election, which creates a climate in which lawmakers are reluctant to cast tough votes that could be used against them in 30-second attack ads. But more deeply, the gridlock in Washington is rooted in a deep partisan divide that has rendered legislating less the “art of compromise,” as Senate Majority Leader Harry Reid (D-Nev.) often calls his line of work, and more a contact sport of “gotcha” politics.

The border bill devolved quickly from a proposal to provide emergency relief to the agencies handling the crush of migrant children who have arrived unaccompanied at the U.S.-Mexico border in recent months. Republicans blamed Obama's immigration policies for enticing the youngsters to the U.S., and Democrats pointed fingers at Republicans for failing to engage in broader immigration reform that could stem illegal crossings.

“This is 100% man-made disaster by the president of the United States,” said Rep. John Fleming (R-La.). “This is Obama's nightmare. By us jumping in, we're making his nightmare our nightmare.”

Republican lawmakers and aides worked late Thursday — after leaders abruptly canceled a vote when it became clear they didn't have support — and through the day Friday to tweak the proposals to attract broader support. Some called that process a textbook example of consensus building, “as messy as it appeared,” said Rep. Steve Womack (R-Ark.), a former mayor. Others grumbled that Sen. Ted Cruz (R-Texas), a potential presidential hopeful, had stoked party infighting by mobilizing opposition to the measure.

The additional $35 million added to reimburse states for deploying National Guard troops on the border would directly aid Republican Gov. Rick Perry of Texas, another potential presidential contender and the only border-state governor to have enlisted the Guard.

Additionally, the new Republican proposal would toughen rules regarding child migrants to send most of them back to their home countries without judicial hearings. Lawmakers also approved a companion bill, 216 to 192, that would halt Obama's Deferred Action for Childhood Arrivals program, which has provided legal status for 500,000 young people, the so-called Dreamers, who were brought to the U.S. illegally as children.

“We're looking at the most anti-Hispanic Congress in generations,” said Rep. Joe Garcia (D-Fla.).

Even the threat of border agencies running out of money could not spur Congress to compromise. Several lawmakers voiced dismay.

“The unfortunate part — and why I'm leaving this place — is we always wait for the last minute to solve it,” said Rep. Jon Runyan (R-N.J.), who is retiring after two terms. “We saw the train come over the horizon ... two months ago, and now you're standing here in front of it.”

lisa.mascaro@latimes.com

Michael A. Memoli and Kathleen Hennessey in the Washington bureau contributed to this report.