A bipartisan House group hammered out an immigration-reform deal late Thursday after years of closed-door meetings and last-minute brinksmanship from a top Democrat.

The final agreement, which could be drafted into legislation by June 1, came together after Rep. Xavier Becerra, D-Calif., dropped what sources said was a blanket objection to denying immigrants healthcare benefits after they become legalized as part of a pathway to citizenship.

The House members and their aides refused to discuss many particulars, although it’s clear that portions of their bill are more conservative than the plan from the Democrat-controlled Senate.

The House plan would call for a citizenship path that lasts 15 years — two years longer than the Senate version.

But it’s not too conservative, either.

“It’s pretty clear if we’re going to pass legislation, it has to be bipartisan,” Rep. Mario Diaz-Balart, R-Miami, said.

“The reason this has been a long, arduous and difficult process — again if I had drafted it myself it would have been different — but the fact is you have to keep both parties on board.”

In the final days, however, that effort was imperiled.

Though Republicans have had the most discomfort with the bill, the specter of partisanship started to arise from Becerra, sources said. Becerra wouldn’t comment to a McClatchy reporter.

Becerra, a California representative, recently began resisting once-agreed upon deals and began making some public statements that made it appear as if he blamed Republicans for stalled talks, according to those familiar with the closed-door talks.

Becerra was the de facto representative of House Democratic leadership in the immigration working group. Becerra represents a district in California, home state of Rep. Nancy Pelosi, the minority leader.

Regardless of who said what and when, it was clear that cracks in the once-united group were forming. The spirit of bipartisanship became strained. And that risked the entire immigration-reform deal in the U.S. House, and perhaps Congress.

The risks, and the politics, haven’t gone away, either. Accusations are flying.

Republicans believe Becerra is trying to slow the House bill down to help Democratic leadership or even the White House pressure Republican House Speaker John Boehner into accepting the Democratic Senate’s so-called Gang of Eight bill, which could be more liberal than a plan that passes the conservative House.

Democrats say Republicans are moving too far to the right to make the measure palatable to the Democrats in the House, whose support will be crucial because conservatives — especially those from the Deep South — are more likely to oppose any immigration-reform plan that has a pathway to citizenship.

Without naming names, Becerra’s fellow Democrat, Illinois Rep. Luis Gutierrez, expressed a measure of concern that people from his own party could be trying to scuttle immigration reform, which has bedeviled Republicans.

“One of the greatest challenges to bipartisanship is the zeal for partisanship,” Gutierrez said, calling on his colleagues to remember the just-ended elections.

“For me, Nov. 6 said stop picking winners and losers. Sit down at the table. Fix this immigration system,” he said. “They didn’t say we’re voting for you Democrats so you can go and exploit the situation.”

Gutierrez also expressed a measure of discomfort with the fact that Becerra appeared to participate in public discussions about the inner workings of the group in a New York Times article, breaking the de facto code of silence that Republicans and Democrats have been able to maintain for years.

“All I can tell you on the record is the article, the underlying premise, is unfounded,” Gutierrez said.

The Times article quoted Becerra as well as unnamed aides, who said that Republicans refused to sign off on a deal between labor unions and big business over a guest-worker program.

But on Thursday it became clear that the major sticking point revolved around Becerra and a conflict over providing health-insurance benefits to those immigrants, currently undocumented, whose status would become newly legalized under the pathway to citizenship.

That issue, the sources say, was brought up by Becerra — and with good reason because the hospital lobby wants more public money to treat undocumented immigrants, for whom care is currently uncompensated.

However, years ago, Republicans and Democrats in the group of House members agreed that immigration reform wouldn’t provide public benefits to those who had broken immigration laws. A change under Obama’s health law, however, necessitated that lawmakers revisit their prior agreement.

“We’re trying to make this as non-taxpayer-funded as possible at any level, including locally,” said Rep. John Carter, a Texas Republican and member of the House group.

“One of our problems in healthcare is overloading the emergency rooms,” he said before the deal was reached Thursday. “So we’re trying to come up with a solution for that. It’s difficult.”

Carter said there was no question that there were political forces at work trying to delay the House bipartisan proposal. That pressure is coming from both ends of the political spectrum.

“There has been no doubt about it,” he said. “There is an element that doesn’t want this to reach the floor before the Senate bill reaches the floor.”

Carter would not say who is putting pressure on whom. And he wouldn’t give details on the deal.

Just minutes after the House bipartisan team reached an agreement on an immigration deal, Carter patted Gutierrez on the back on the House floor during unrelated votes. Both had big smiles on their faces.

The relief was a long time coming. The group in one form or another has met since 2009. Members expected to release their bill ahead of the Senate, but talks got bogged down.

However, because they’ve met for so long, the legislation is nearly drafted in its entirety. So it should be released in the coming weeks.

It’s just in time for Boehner, who said Thursday morning that he was worried.

“I am concerned that the bipartisan group has been unable to wrap up their work,” he told reporters Thursday morning.

Going forward, the politics become trickier. The bill has to go through the House Judiciary Committee, which is stacked with conservatives.

In the Senate, Florida’s Marco Rubio says their bill can’t survive in the Republican House as currently drafted. But a too-conservative bill could suffer in the Democratic Senate.

How the members walk that fine line is yet to be seen.

Not only is immigration a complicated topic, it’s easier to use it to score political points in Congress, Gutierrez said.

“It’s almost like it’s almost impossible to tell people: Stop fighting,” he said. “It’s like mixed martial arts. It is very, very difficult.”