In May, a House committee unanimously approved a border-security plan that both parties have praised. (Jahi Chikwendiu/THE WASHINGTON POST)

In mid-May, as most of Congress was consumed with the troubles at the Internal Revenue Service and the Senate was conducting closely watched hearings on a sprawling, contentious immigration reform bill, something remarkable happened in the House Homeland Security Committee.

With little fanfare, the committee unanimously passed a border-security plan as part of its immigration reform effort.

Unanimously. All the Democrats and all the Republicans voted the same way on the same issue. And not just any issue, but securing the border against illegal immigrants — as acrimonious and politically polarizing as any.

Unanimous does not happen much in Washington anymore. And rarer still, House Speaker John A. Boehner (R-Ohio) and House Minority Leader Nancy Pelosi (D-Calif.) have found themselves on the same side of the issue, with each publicly praising the bill in recent weeks.

The committee vote was the most hopeful sign to emerge from the House that some kind of immigration deal with the Senate is possible.

The House will leave Washington this week for a five-week summer break without voting on any immigration bills, but members of both parties are working to build support for the border-security plan, which Republican aides expect will be the first immigration measure Congress votes on when it reconvenes in September.

In some ways, the narrow agreement on border security in a House committee may be the gateway to a broader agreement on immigration.

It clears the way for Republicans who need to address concerns about security along the U.S.-Mexico border before voting on any other bills related to the nation’s roughly 11 million undocumented immigrants.

Meanwhile, the solid Democratic support for the GOP-sponsored measure on this most intractable of issues is an encouraging signal that immigration may not be doomed by the sharp partisanship that is ubiquitous in Washington.

Rep. Michael McCaul (R-Tex.) chairs the Homeland Security Committee and oversaw a process that aides say included 42 separate drafts of his 26-page bill.

“This isn’t something we threw together at the last minute,” McCaul said in an interview. “We’ve been working together for years on this, with studies and consultations with the experts.”

That approach is in contrast to the way the Senate arrived at its border-security plan. Seeking as much bipartisan support as possible, the authors of the Senate legislation scrapped a carefully crafted plan at the end of June and replaced it with one that calls for a “border surge” of almost 20,000 additional Border Patrol agents and the construction of about 700 miles of fencing, at a cost of $46 billion.

The plan would create what supporters call “a virtual human fence,” or enough manpower to deploy agents every 1,000 feet along the 2,000-mile border, from San Diego to Brownsville, Tex.

The House bill doesn’t set an exact price or timeline or mandate a certain number of hires. Instead, it instructs the Department of Homeland Security to write a plan that could ensure the apprehension of 90 percent of illegal border-crossers in high-traffic areas within 33 months and across the entire southern border within five years. The measure directs the department to find ways to deploy existing U.S. military radar, cameras and unmanned aerial drones used recently in Afghanistan and Iraq. Congress would need to review and approve the plan before appropriating any money.

Detailed decisions about equipment, manpower and suggested costs would be left to career Homeland Security officials, who would consult with border-state governors and government experts who track security and immigration flows. The independent, nonpartisan Government Accountability Office would be required to assess the proposed strategy and report back to Congress on its implementation.

If the House bill passes, aides said, Senate Democrats will be willing to negotiate on border security so long as it is part of a package of bills that includes a “pathway to citizenship” or permanent legal status for the nation’s undocumented immigrants.

The House measure also has some cheerleaders among Senate Republicans. Sen. Bob Corker (Tenn.), a lead sponsor of the Senate’s border proposal, said he is open to supporting it.

“Any action that the House might take on immigration reform is positive,” Corker said, adding: “As long as they’re moving ahead with some kind of immigration policy, I’m going to be cheering.”

Conservative House Republicans say they prefer their chamber’s bill because it respects the “regular order” committee process, sets only general goals and asks government professionals, instead of politicians, to lay out specific plans.

For the past several years, “we’ve seen the doubling of agents and we have not seen the doubling of the security of the border,” said Rep. Stevan Pearce (R), who represents the southern half of New Mexico and plans to support the House bill.

“I think we need to support that bill,” said Rep. Raul Labrador (Idaho), a former immigration lawyer and a leading voice on the issue for GOP lawmakers. He said he might also propose finding ways to allow local police and sheriffs departments to help enforce federal immigration laws.

Pearce and Labrador find themselves in rare accord with many House Democrats, who strongly oppose the Senate’s proposals to send tens of thousands more agents into border towns and deploy surveillance technology once used in war.

“I think that a lot of Democrats, especially those along the border, would probably say that [the Senate] voted on things in the abstract,” said Rep. Xavier Becerra (Calif.), the fourth-ranking House Democrat. “For us, they’re not abstract, because what you vote on may become law, and it will hit us back home where we live in these border communities.”

Rep. Beto O’Rourke (D-Tex.) represents the El Paso area and called the Senate border plan “wasteful and unnecessary,” because it would jeopardize the billions of dollars in U.S.-Mexico trade that passes through his district.

O’Rourke said in an interview that “when I approached some of the senators about this, they said, ‘This stinks, but we have to hold our nose and move forward.’ And I said: ‘It stinks, but you don’t have to live with it. The 6 million who live on the U.S. side of the U.S.-Mexico border have to live with it.’ ”

O’Rourke and other Democrats representing border districts credit McCaul for working closely with the committee’s senior Democrats, including Rep. Sheila Jackson Lee (Tex.), who rarely finds herself in agreement with Republicans but is one of the bill’s most vocal supporters.

“The Senate used a train that they needed to get out of the Senate,” she said in an interview. “What we did in the House is that we recognized the diversity of our caucus and we recognized the importance of our border members, and I’m very grateful that [Republicans] listened.”

Rep. Filemon Vela (D), a freshman lawmaker representing the southern tip of Texas, was so upset by the Senate’s plan to deploy thousands more border agents that he dropped out of the Congressional Hispanic Caucus when the group didn’t forcefully denounce the proposal.

“I think that the Senate bill is wrong and misguided and shouldn’t become part of any final package,” he said.

Vela and other Democrats from border districts are pushing for billions of dollars in infrastructure spending to reduce wait times at border crossings. Even if those proposals are ignored, he’ll support the House border plan — and continue seeking votes on other immigration bills.

“I think we have to be realistic that we’re part of a body of 435 people and there has to be compromise at some point to move anything forward,” Vela said.