In June, not long after Donald Trump attacked an Indiana-born judge because he was “Mexican,” I went to go see Representative Raúl Labrador in the Longworth Office Building on Capitol Hill. Labrador, an Idaho Republican, cuts an unusual profile in Washington. Born in Puerto Rico, he was raised Mormon by a single mother in Las Vegas and now, as he told me, represents “one of the most conservative districts in the United States, one of the whitest districts in the United States.” Labrador came to Congress as part of the Tea Party wave of 2010 and later helped found the Freedom Caucus, the House’s conservative vanguard. He was also a pivotal member of a bipartisan group of eight House members who, in early 2013, came together in hopes of producing comprehensive legislation to fix the nation’s immigration system.

Today, nearly every word of that last sentence feels as if it were ripped from a political fiction of “West Wing”-level implausibility. Immigration is the conflict that has eaten the 2016 elections — relegating other pressing issues to the margins, embodying Washington’s political dysfunction, further polarizing a divided country and, above all, fueling the presidential campaign of a man who began his candidacy by vowing to build a wall to keep Mexico from sending “rapists” to America. In recent weeks, even Trump’s own campaign seems to have grown alarmed by the political toxicity of what it has unleashed, embarking on a series of incoherent revisions before settling back on hard talk about creating a “special deportation task force.”

The Great Republican Crack-up Dayton was once a bastion of the GOP establishment. The story of how the city changed helps explain the rise of Donald Trump. Read the story. Email Updates Sign up to get ProPublica’s major investigations delivered to your inbox.

But just four years ago, Republican leaders, coming off a presidential election in which their candidate received barely a quarter of the Hispanic vote, made a concerted push to reach a compromise on immigration reform. President Obama, too, elevated it as one of the top issues of his second term. Two days after the election, Speaker John Boehner told ABC News that reform was “long overdue,” saying that “I’m confident that the president, myself, others can find the common ground to take care of this issue once and for all.” At a time when Congress, because of the strategic calculus of its Republican leadership, was struggling to pass such once-rudimentary measures as budgets and highway bills, and bipartisan legislative efforts had become a snow-leopard-like rarity in Washington, it was a remarkable moment: The parties’ imperatives had converged on what everyone involved envisioned as a historic piece of legislation to resolve one of the nation’s most conspicuous problems, a broken immigration system that had left 11 million people undocumented.

The immigration bill was supposed to be a relatively straightforward endeavor — not politically painless, by any means, but a clear win for all the parties involved, enough so that it came much closer to happening than most people think. “I’ve never been involved in an issue where there’s no organized opposition to it,” Representative John Yarmuth of Louisville, Ky., one of Labrador’s Democratic colleagues in the Group of 8, told me. “It’s so bizarre when you have the business community, organized labor, the faith community, law enforcement, you name it, everybody’s for it. Come on — how can you have something everybody’s for and not get it passed?”

But the bill did not pass. And its failure revealed how fully the Republican Party had boxed itself in in Congress — the degree to which it had been paralyzed by its own extremity and tactical logic, and the degree to which this intransigence had produced a cynicism among Democrats that amounted to a self-fulfilling prophecy. In retrospect, Congress left itself open to the rise of someone like Trump, who, with his blend of nativism and anti-Washingtonism, was able to draw on resentment of undocumented immigrants themselves and resentment of Washington’s inability to come up with a solution for the problem.

I didn’t bring up Trump in my conversation with Labrador, but Labrador did. In the midst of talking about the collapse of the immigration-reform effort he had been part of, he broke off and said, matter-of-factly: “The reason we have Donald Trump as a nominee today is because we as Republicans have failed on this issue.”

Democrat Xavier Becerra had gotten the House talks on immigration reform started in 2007 with Republican Sam Johnson. In late 2012, he approached Johnson. “We’ve got Barack Obama for another four years. Think we can start talking again?” (Jeff Brown for The New York Times)

“We could figure this out”

It’s easy to forget how recently the Hispanic vote was viewed as up for grabs. In 2004, George W. Bush won 44 percent of Latino voters. As late as 2006, Democrats and Republicans responded similarly to a Pew Research Center question about whether immigrants “strengthen our country because of their hard work and talents,” with about 40 percent in each party saying yes.

Seeking to secure lasting Hispanic support for Republicans, Bush in 2007 threw his support behind a bipartisan push for comprehensive immigration reform on the Hill. But the legislation failed amid a talk-radio-fueled backlash over “amnesty” — granting legal status to many immigrants who arrived in the country illegally — as well as a lack of political capital on Bush’s part and ambivalence among many Democrats and organized labor about the bill’s provisions.

In late 2007, after that effort foundered, Representative Xavier Becerra, a Los Angeles Democrat, approached Representative Sam Johnson, a Republican from the northern suburbs of Dallas. Becerra, the American-born son of Mexican immigrants, had grown up hearing his father talk about seeing “No dogs or Mexicans” signs in windows. By his estimate, his district held more noncitizens than any other in the country, and it seemed to him that his entire career in Congress had been defined by the fight to bring clarity for those people and their families.

Johnson, a retired Air Force colonel who spent nearly seven years in a North Vietnamese prison after being shot down during the Vietnam War, was staunchly conservative but not doctrinaire; Becerra was easygoing and well-liked by many of his Republican colleagues. The two congressmen had worked together in the past. “I said, ‘Sam, I betcha you and I, we’re about as opposite as you can get, but if you and I sat down, we could figure this out,’ ” Becerra says. “He said, ‘You know what, partner, you’re probably right.’ ”

Becerra and Johnson invited colleagues to expand the conversation, and by the 2008 election, the group had grown to 16. They met often, for hours at a time, and always behind closed doors, to protect the Republicans participating — memories of the 2007 backlash lingered. By 2010, they had the bones of a bill. “It became clear that there were a whole bunch of R’s that wanted to get this done,” Becerra told me.

The essential elements of any comprehensive reform package had been clear for some time: improving enforcement for those overstaying their visas; tightening border security; easing the route for legal entry to reduce future illegal immigration and supply the work force; and coming to a disposition for the millions already in the United States. In early 2010, the group worked through the usual tension points — how many guest workers to allow for agriculture and other seasonal employment, what kind of compliance to demand from employers, how many visas to grant for high-tech workers from abroad, how long the path to citizenship for those granted legal status should be and so on.

They made real progress that year, but outside the room, the climate was deteriorating. House Republicans had mounted party-line opposition to Obama’s economic-stimulus package, climate legislation and Obamacare. There also simply wasn’t the necessary time or attention available, the secretary of homeland security at the time, Janet Napolitano, told me. “The energies of the administration were focused on the economy, and we were still in Iraq and Afghanistan,” she says.

That fall, Republicans swept the House, deposing many of the Democrats involved in the immigration effort, and the talks came to an abrupt end. The lesson was plain: Bipartisan huddles were well and good, but they meant little in the absence of will on the part of party leaders.

That will suddenly materialized after Mitt Romney’s decisive loss in the 2012 presidential election. Romney won just 27 percent of the Hispanic vote, devastating his chances in swing states like Florida, Nevada and Colorado. Republican leaders and conservative pundits took a hard look at his 44-point deficit with Hispanics and saw in it both threat and opportunity. On one hand, a Republican Party that could not attract Hispanic voters risked demographic obsolescence. On the other, a party that could attract those voters might not need to change much else in its policy platform.

It seemed a seductively easy fix. “There’s no need for radical change,” the conservative Washington Post columnist Charles Krauthammer, who had previously opposed reform, wrote two days after the election. “The other party thinks it owns the demographic future — counter that in one stroke by fixing the Latino problem.” Also announcing his conversion that day was Sean Hannity of Fox News. “It’s simple to me to fix it,” he said. “If people are here, law-abiding, participating for years, their kids are born here, you know, first secure the border, pathway to citizenship, done.”

Eight days after the election, Bill O’Reilly aired a segment on immigration reform on his Fox News show and invited on Luis Gutiérrez, a Democrat born to Puerto Rican parents who represents part of Chicago and for a time participated in Becerra and Johnson’s bipartisan talks. “I have many Republican colleagues, good men and women,” Gutiérrez told O’Reilly. “And you know what they’ve been telling me? They said: ‘Luis, let’s take this off the table. Let’s take it off the table once and for all, or you’re going to run the tables on us.’ ”

The following day, Gutiérrez was at the House of Representatives’ gymnasium when he spied the Republican Party’s most famous gym rat: Representative Paul Ryan, who was readjusting to normal life in the Capitol after the Romney campaign. “Hey man, I did everything I could to be sure you couldn’t be vice president,” Gutiérrez told him. “Just joking.”

Ryan took the gibe in stride, then got down to business. He told Gutiérrez that he’d seen him the night before on O’Reilly’s show. “He said to me, ‘I don’t want to do it to take it off the table, Luis,’ ” Gutiérrez told me. “ ‘I don’t want to do it because it’s politically expedient. I want to do it because it’s the right thing to do, because I’m Catholic, and my Christian values say we cannot have millions of people in second-tier status.’ I was like, Brother, you and I are going to get along just fine.”

The Republican National Committee, for its part, had convened the Growth and Opportunity Project, a wide-ranging overhaul — the commentariat called it the party’s “autopsy” — that, among other things, aimed to determine how the party could fare better with Hispanic voters. In December, Ryan was at the Capitol Hill Club, the Republican social organization a block from the Capitol, when he spotted Ali Noorani, executive director of the nonpartisan National Immigration Forum. Ryan “talked my ear off” about immigration reform, Noorani recalls. “He said, ‘We’re going to do a conservative, five-bill package, with a different coalition of members for each bill.’ ”

The White House and congressional Democrats were eager to take the Republicans up on their new resolve. Obama had incurred the wrath of immigrant advocates by presiding over hundreds of thousands of deportations — making an explicit exception only for immigrants brought to the country as children — precisely in order to build up credibility with Republicans for this moment. And Congress wouldn’t be starting from zero; they still had the groundwork laid by Becerra and Johnson’s aborted post-2007 effort. In December 2012, Becerra approached Johnson again. “We’ve got Barack Obama for another four years,” he told him. “Think we can start talking again?”

Luis Gutierrez, a Chicago Democrat of Puerto Rican heritage, was cheered when Paul Ryan expressed strong support for immigration reform to him after the 2012 election, in the House gym. “I was like, ‘Brother, you and I are going to get along just fine.” (Jeff Brown for The New York Times)

“The only two criteria”

Among the members of the reconstituted House immigration group was Mario Diaz-Balart, a Republican from Miami. In Florida, the Diaz-Balarts are a political dynasty. Mario’s grandfather and father were legislators and held other offices in Cuba during the Batista years; his aunt was Fidel Castro’s first wife; his older brother Lincoln was a recently retired congressman who had also been in Becerra’s group of 16. (A younger brother, José, is a news anchor on Telemundo.) Mario, who has the bluff, jocular bearing of the classic urban politician, saw himself as a dealmaker who could skirt partisan ruts to achieve a historic breakthrough.

After the 2012 election, Diaz-Balart instructed his chief of staff, Cesar Gonzalez, to open a back channel to the Obama administration. Gonzalez tried to reach the White House domestic-policy adviser Cecilia Muñoz, the daughter of Bolivian immigrants and a longtime immigrant advocate who was the administration’s point person on the issue, to set up a meeting at an exurban Starbucks where no one would recognize them. After some prodding, Muñoz agreed instead to call Diaz-Balart one day in January. Gonzalez told her that any time would work, except for one 20-minute window in which his boss was meeting with a foreign minister. Muñoz called during that window.

After that, Gonzalez pleaded with Muñoz to coordinate better and asked if the administration had any big moves planned on immigration. Muñoz said it did not. Shortly after Gonzalez hung up the phone, news broke that Obama planned to give a speech in Las Vegas demanding that Congress pass immigration reform. Gonzalez got the message: He and Diaz-Balart were on their own.

As that episode suggested, the Obama administration and Democratic congressional leadership did not see eye to eye with the House immigration group. In the administration’s view, the path to immigration reform ran not through the House but through the Senate, where another bipartisan group was at work on the issue. The Senate was still under Democratic control and could be counted on to produce legislation closer to the administration’s ideal.

The Democrats’ ambitions for a more liberal bill also reflected how much, and how quickly, the politics of immigration had shifted — a shift that occurred mostly within the Democratic Party. In Pew’s regular polling on the issue, the share of Republicans saying that immigrants strengthened the country had dipped slightly since 2006. But the percentage of Democrats saying so had soared to around 70 percent. Reform would eventually need the approval of the House, of course, where Republicans held a 33-seat edge. But the administration was proceeding on the assumption that legislation based on the Senate bill, when it was passed, would be able to clear the lower chamber with the backing of most Democrats and some Republicans. Obama’s staff had counted the votes and felt sure they were there.

This plan, however, hinged on one assumption: that Boehner would be willing to hold a vote on the legislation. Dennis Hastert, the previous Republican speaker, had formalized a Republican custom — now known as the Hastert rule — by which the speaker would not bring up a bill for a vote if it did not command support from a majority of the party’s caucus. Boehner had held to the Hastert rule in all but a few cases.

But in early 2013, Boehner was speaking often with Obama about immigration and giving every indication of being very serious about doing whatever it took to pass legislation. So the White House focused its efforts on shaping the Senate bill, while limiting its House considerations mainly to building the outside coalition — supporters from law enforcement, the evangelical community, small businesses and corporations — that would provide cover for an eventual vote.

The administration’s focus on the Senate did not dissuade the House group from forging ahead. The lawmakers began holding marathon meetings again, switching locations among House offices to throw the press off the scent, with members taking turns picking up the dinner-catering tabs. The four Republicans were Johnson, Diaz-Balart, Labrador and Representative John Carter, a former judge from central Texas. The Democrats were Becerra, Gutiérrez, Yarmuth and Representative Zoe Lofgren of San Jose, Calif.

As had been the case in past efforts, the basic approach to reform was no mystery: Everyone agreed it would involve improving border security and internal visa enforcement, rationalizing the system for legal entry and allowing most of those already here to stay. (Polls in early 2013 showed strong public support, around 70 percent, for such a package.) “The ground rules were that we wanted to come up with something that fixes the problem and can pass,” Yarmuth says. “Those were the only two criteria.”

The group was under no illusions that it would be easy to get the bill through the House. Diaz-Balart says that Boehner was all along telling him that whatever bill they came up with should ideally command a majority of Republican support, thus conforming to the Hastert rule. Getting a majority did not seem out of the question to Diaz-Balart. A small core of Republicans would be viscerally opposed to any immigration bill. But this group, by Diaz-Balart’s reckoning, was not much larger than the group firmly in favor of reform, and the great mass of House Republicans, he thought, was not out of reach.

This last group was wary of immigration — uncertain on the policy details, uncomfortable talking about it and oversensitive to the calls they got from constituents and activists opposed to it, despite the fact that very few members had ever actually been threatened over the issue by a primary challenger. But this mass operated with a herd instinct. With safety in numbers, it could potentially be moved. “Most people realize the system we have is broken,” Diaz-Balart told me.

Mario Diaz-Balart, a Miami Republican from a family with deep political roots in Cuba, instructed his chief of staff to try and open a back channel to the White House on immigration reform in early 2013. But the administration was focused on the Senate. (Jeff Brown for The New York Times)

“It was an intervention”

Luis Gutiérrez was, by his own admission, not exactly a Democratic Party foot soldier when it came to immigration reform. Getting relief from the threat of deportation for families trumped all else, even party loyalty. He had been a holdout on Obamacare over the question of undocumented immigrants not receiving benefits and over the administration’s deferral of immigration reform — to the point of being upbraided at a meeting by Valerie Jarrett, Obama’s consigliere, who asked him why he wasn’t falling in line. “It was an intervention, and I was the drug addict,” he jokes.

In April 2013, as the Senate and House groups were plugging along with their bills, Paul Ryan joined Gutiérrez at a Chicago City Club luncheon to push immigration reform. Gutiérrez was also seeing what seemed like encouraging signs from Boehner. But he was starting to get worrisome signals from the Democratic leadership in the House, the Senate and the White House — a sense that they weren’t taking the House group’s effort seriously. They, along with reform advocates, were focusing all their attention on the Senate bill to a degree that he found nonsensical.

The R.N.C.’s Growth and Opportunity report, ordered up after Romney’s loss and released on March 18, did not mince words. “We must embrace and champion comprehensive immigration reform,” it argued. “If we do not, our party’s appeal will continue to shrink to its core constituencies only.” Democratic leaders essentially took that language at face value, assuming House Republicans were under orders to deal with the issue. They were wagering that they could get a better bill by ignoring the House group’s work; if that project failed, then the Democrats could simply press the more liberal Senate bill upon the House. “It was clear to me that no matter what I negotiated, they didn’t want me to really reach an agreement, because they wanted to go with the Senate version,” Gutiérrez says.

To Gutiérrez, this was borderline delusional; it ignored both the House’s longstanding resentment of being seen as subordinate to the Senate and the weak position of Republican leaders, whose edicts about demographic imperatives carried only so much weight with members in safe districts with few Hispanic voters. Gutiérrez told me that when he pointed out to Senate Democrats and immigrant advocates all the House Republicans who had sworn they wouldn’t accept the Senate bill, they waved off his concerns: “ ‘Don’t worry, Luis. Whatever you do, we’re going to overwhelm them with such a huge vote in the Senate’ ” — with lots of Republicans — “ ‘that they will take the Senate bill.’ It was not a plan for success.”

The Republican contingent had its own iconoclast in the form of Raúl Labrador. The Idahoan had worked for 15 years as an immigration lawyer, which made him a natural addition to the House group — a perfect liaison to the new Tea Party-aligned wing of the caucus who also had a professional understanding of the issue.

To his Democratic colleagues, Labrador’s assertive good cheer belied his doctrinaire conservatism. “Labrador,” Gutiérrez told me, “is the kind of guy, if your car broke down, he’d come by and help you fix your tire and get you back on the road — and if it was too late, you’d stay at his house. But don’t expect him the next day, you know?” Labrador’s mantra was that any legislation had to avoid repeating the failures of the 1986 immigration law signed by Ronald Reagan, which Labrador argued provided inadequate enforcement alongside its amnesty provisions. “The principle is you cannot make the mistake of Reagan,” Labrador told me.

Labrador arrived with a list of conservative criticisms of what the group was drafting. As the group worked through issues he raised, there was something that bothered him: the way the Democrats kept having to seek approval of agreements the group had reached with the office of the top House Democrat, Nancy Pelosi. “The four Republicans,” he told me, “were told by the speaker and the people in charge, ‘You come up with a deal.’ The Democrats did not have that independence. They had to run everything by their leadership.”

Labrador soon discovered that there was one point on which the Democrats in the group were particularly sensitive. The group that met in 2010 agreed that immigrants seeking legal status would need to pay for the cost of their own health care. The Affordable Care Act had complicated this requirement by eliminating the cheap catastrophic health care plans that low-income immigrants could most easily afford.

In negotiations, Labrador insisted that undocumented immigrants would need to be made explicitly ineligible for any health care subsidies whatsoever — that, as he put it to me, “taxpayers are not going to be stuck with a dime.” He even questioned the status quo of hospitals’ paying for emergency treatment for undocumented immigrants with federal funds for indigent care, demanding that the immigrants be required to pay off their bills over time.

House Democratic leaders, including Pelosi, argued that this could have the effect of sending people into bankruptcy, forcing them to leave the country. If the Democrats were so worried about immigrants’ ability to meet the requirement, Labrador countered, they could carve out an exception to Obamacare, allowing catastrophic plans.

Labrador’s demands created a bind for the Democrats — especially Xavier Becerra, who helped found the group back in 2007. Among the Democrats, Becerra was now often the most wary of tentative agreements within the group, saying they needed to be run past Pelosi. (Becerra says he was simply concerned about the language being “unworkable.”) “His attitude changed dramatically,” Diaz-Balart says. “Gutiérrez had been a straight shooter — ‘I can’t go any further than this.’ You know where he stands.” Becerra, he said, “had been fine, and then it was like a switch, wham. … It was like, whoa.”

Raul Labrador, a Republican, was born in Puerto Rico, was raised Mormon in Las Vegas by a single mother, and represented western Idaho. He was the Tea Party’s man in the group. “The principle is you cannot make the mistake of Reagan,” he said. (Jeff Brown for The New York Times)

“I’m making a decision here”

Gutiérrez had some idea what had happened. Becerra had risen to the No. 4 slot among House Democrats and was close with Pelosi, who in turn was in constant communication with the White House. Gutiérrez himself was under great pressure from Pelosi not to give up too much to the Republicans — especially nothing that would undermine Obamacare. Gutiérrez shrugged off her admonitions. “I just found it extraordinary that every time we reached an agreement on something, then we had to go back to House Democratic leadership to explain it all over again,” he says. Lofgren was more diplomatic. “Becerra is a very cautious man,” she told me.

The mind-set that Gutiérrez was contending with among Democratic leaders was hardly incomprehensible. They had for years faced total Republican intransigence on any bill that might be of political value to Obama. The notion that the House could now muster legislation on so thorny an issue was hard to credit; in my conversations with White House and Senate Democratic staff members, their estimation of the House’s efforts on immigration oozed condescension verging on scorn. House Republicans had become trapped in a cage of their own making: On the one side they were hemmed in by a constituency and far-right contingent opposed to compromise on principle. On the other side were Democrats who, even when many Republicans did want to pass a law — one the Democrats wanted, too — responded with a collective eye roll.

Soon enough, Gutiérrez’s warnings to Democratic leaders proved prescient. In mid-April, the Senate group introduced its bill, whose generally liberal provisions — a path to eventual citizenship for most of those in the United States illegally, generous levels of visas for family reunification and fewer guest-worker permits than many businesses wanted — and association with Senator Chuck Schumer of New York, the dominant Democrat in the group, predictably riled House Republicans. Labrador and the two Texans, John Carter and Sam Johnson, started coming under pressure for their involvement. On May 15, Carter delivered an ultimatum: If there wasn’t resolution at the group’s next meeting, the next day, he was out. For the first time, the meeting’s location in one of the House office buildings was leaked to the press. A couple dozen reporters massed outside the room, ready to pounce if Carter or anyone else walked out.

Inside, Lofgren proposed new language on health care. Her colleagues gathered to read it over her shoulder on her new iPad Mini. It was very vague, essentially stating that immigrants would need to pay for their own health care and that if any government entity provided them with services, they would be ineligible for permanent residence. Everyone seemed provisionally in favor of it — except for Becerra. The Republicans were exasperated. “F Becerra,” Gonzalez, Diaz-Balart’s chief of staff, emailed a colleague. “Ugh. Now I’m looking for window.”

There is no act more central to a democracy than voting. Electionland is a project that will cover access to the ballot and problems that prevent people from exercising their right to vote during the 2016 election. Read more about it.

The group broke into separate rooms, Democrats in one and Republicans in another. When the group reassembled, the Republicans said they were fine with the language. Then Becerra said he would have to run it by Pelosi.

Carter exploded. “I don’t have to check it with John [Boehner], why do you have to check with Nancy?” he said, according to Gonzalez and others in the room. “I’m making a decision here — why can’t you?”

The group left the meeting saying they had a tentative agreement, but in the days that followed, the Democrats backed away. At a meeting with the group’s Democrats, Pelosi loudly scolded Gutiérrez for having strayed too far from his brief on immigration. Gutiérrez himself was furious that health care had assumed such importance. At the next meeting of the group, Gutiérrez asked the staff members to leave, which was unusual, and berated Becerra for having made things so hard.

It was the Republicans, however, who finally broke first. On June 5, 2013, Labrador announced he was leaving the group, saying the health care issue had become insurmountable and that he would focus on crafting Republican-only legislation instead. It was a grievous blow to the group, coming after it had gone to great lengths — falling behind the Senate in drafting its bill — to address Labrador’s complaints on multiple fronts. Democrats I spoke to viewed his protestations as fundamentally cynical, an excuse to kill a bill he was ambivalent about by placing it in conflict with the other party’s most treasured recent legislative accomplishment. “If people want to get to an outcome, they can get to an outcome,” Muñoz said, and sighed. “Look, there’s a reason why no bill ever got introduced. Had a bill been introduced, the pressure to bring it through the process would have been very, very high, which was why they never introduced it.”

Labrador’s exit provided some relief at first. “He’s a very emotional guy, and everybody was like, whew,” Lofgren says. “It was easier to have discussions that were productive with Labrador out, because people could focus and not go off on tangents.” The group also kept getting encouragement from Boehner. He surprised Lofgren by inviting her to a private meeting. “He said: ‘Keep this going. This is really important. This is the best chance we have.’ ”

The subtext of Boehner’s pep talk was that the political context around the issue was changing, in unhelpful ways. He was coming under increasing pressure from his conservative flank to vow not to break the Hastert rule on immigration. The increase in drug trafficking from Mexico was giving opponents more fodder. Representative Steve King of Iowa warned that summer of immigrants with “calves the size of cantaloupes because they’re hauling 75 pounds of marijuana across the desert.” And the Senate, by having released its bill first, had given opponents something to push back against.

Support for the bill from Republican-allied outside groups like the U.S. Chamber of Commerce was registering less in the House than hoped. And the memory of the 2012 loss was fading. Members were talking up a series of posts by Sean Trende, a RealClearPolitics.com analyst, that presented an alternate explanation for the defeat. Contrary to conventional wisdom, Trende argued, Republicans did not need more Hispanic support to win the presidency. They just needed to draw out the “missing white voters” Romney had failed to excite.

On June 18, Boehner stated more definitively than before in a meeting with fellow House Republicans that he would not allow an immigration reform bill to come to the floor without a majority of Republicans behind it. The following week, the Senate passed its bill by a vote of 68-32, with 14 Republicans in favor — the sort of decisive victory that Democratic leaders had banked on. But in a meeting of House Republicans in the Capitol basement, Boehner said the House would not take up the Senate bill and would instead continue to produce its own legislation.

What legislation, immigration reformers wondered, was Boehner talking about? The Group of 8 had not yet produced a draft. The support that Paul Ryan had communicated so enthusiastically to Gutiérrez in late 2012 was also proving elusive. On Sept. 10, Diaz-Balart hosted an evening meeting at his apartment to discuss a path forward on immigration, with Ryan, Labrador and a handful of staff members. But the evening wore on with barely any mention of the issue. It was the night of Obama’s speech announcing that he had asked Congress to postpone its vote on authorizing airstrikes on Syria. The group watched the speech, hung around for a while and then dispersed.

Ten days later, Sam Johnson and John Carter announced that they, too, were officially leaving the bipartisan group, rendering it defunct. They were under increasing pressure for participating, and since Labrador had left and taken with him the group’s line to the House’s Tea Party contingent, the project’s efficacy was in doubt. After all the years spent haggling together in small rooms, the news of the Texans’ departure reached the other remaining members via news release.

John Yarmuth, a Democrat from Louisville, Kentucky, was added to the group when it reassembled in early 2013. He was optimistic, at first. “Come on,” he said. “How can you have something everybody’s for and not get it passed?” (Jeff Brown for The New York Times)

“My own guys aren’t with me”

After the Group of 8 disintegrated, Boehner seemed adrift on immigration. In January 2014, he announced a set of “standards” for the legislation at a party retreat, but they went over poorly, and even supporters of reform were puzzled by their purpose. “That kind of fell like a lead balloon,” Diaz-Balart told me. After members heading into primary season for the 2014 midterms complained that it wasn’t a good time for the issue, Boehner announced that he would not proceed after all.

Boehner’s No. 2 and likely successor, Eric Cantor, was even more wary. “He was one of the most hard-ass guys we dealt with,” Diaz-Balart says. “He was always fair but very tough on us.” On May 12, Boehner was in Laredo, Tex., on the Mexican border, during a fund-raising tour, when he ran into Ali Noorani, the immigration-reform advocate. Noorani asked Boehner where things stood. “In all my years in public service, I’ve seen weird issues, but this is the weirdest,” Boehner said, according to Noorani. “My own guys” — his fellow party leaders — “aren’t even with me on this.”

Diaz-Balart and Gonzalez, meanwhile, were making a last-ditch effort to salvage the group’s work. For months, they had quietly pitched to House Republicans an idea for a bill that would combine heightened border security and visa enforcement with legalization for many of the 11 million but, unlike the Senate’s bill, would offer no dedicated path to citizenship. They were getting moral support from Ryan, who saw their proposal as in keeping with what he had outlined to Noorani in late 2012, the central plank in a series of bills. They got clearance from Boehner, if no direct aid from his leadership staff, on one condition: “You get the majority of the majority.”

They assembled their own team of a dozen or so representatives, including several ardent conservatives, to assist in approaching members. They brought together small groups of members to review results from two different pollsters showing surprisingly strong support from Republican voters and to watch a focus group where voters backed the language they were settling on. They tracked members’ likelihood of support, on a 1-to-5 scale, on an Excel spreadsheet.

Gutiérrez assured them that they could get sufficient Democratic support even without a special path to citizenship, on the assumption that millions could eventually attain citizenship even without such a path; he had briefed Pelosi on the proposal and she had not waved him off it. Diaz-Balart even finally got a call from Obama. It felt perfunctory, but at least it was something. Gonzalez had become so desperate to reach Muñoz by early 2014 that he emailed her during a visit to the White House Easter Egg Roll asking if he could come in and see her.

On June 10, as primary season was nearing its end, Diaz-Balart told House leaders that his count of Republicans supporting his immigration-bill language was up to 140 — well above a majority of the caucus. Boehner scheduled a meeting for later in the week to decide how to proceed. Reform-advocacy groups, including the one formed by Mark Zuckerberg, readied a blast of ads in support of imminent legislation. Diaz-Balart was ebullient. He took a couple of bottles of wine back to his apartment to celebrate with Gonzalez and others.

They were gathering when, around 7 p.m., Diaz-Balart got an email from another member. The colleague had seen some worrying numbers coming out of Virginia, where polls had just closed in the Republican primary. Eric Cantor was defending his seat against David Brat, a conservative economics professor who had mounted a challenge inveighing against Cantor’s Wall Street ties, his inattention to his district and his support — grudging as it was — for immigration reform. Diaz-Balart dismissed it as early noise. “We were going to toast,” he said. “And then all of a sudden. … ”

It wasn’t even close. Cantor lost by 11 points. When one top Democratic Senate immigration aide found out, she burst into tears, knowing that reform opponents would seize on Cantor’s loss as a referendum on the issue, regardless of Cantor’s ambivalence on it. Gutiérrez called Diaz-Balart. “Luis,” Diaz-Balart told him. “We lost the whole thing. It’s over.”

Reform advocates scrambled together an emergency effort to counter the spin, promoted by opponents like the talk-show host Laura Ingraham, that Cantor had lost because of immigration, but it was to no avail. “People got concerned, and we didn’t have the ability anymore to keep the numbers,” Diaz-Balart says. “They came to me on the floor the next day and said, ‘Hey, man, I know I whipped, but this is not the time.’ ”

The administration read the writing on the wall, too. Two weeks later, with a surge of unaccompanied minors from Central America giving more fuel to reform opponents, Obama said his staff would start drafting executive action on immigration in lieu of legislation.

When Diaz-Balart held a news conference shortly afterward, he was so upset that he had trouble speaking. He singled out Gutiérrez for his help and his “willingness, when necessary, to take on Republicans, Democrats and the president.”

“It is highly irresponsible not to deal with the issue,” he said. “We were sent here by the American people precisely to tackle difficult issues and not to take the easy way out.”

Zoe Lofgren, a Democrat from San Jose, had been on the group since early on. She was surprised when John Boehner invited her to his office in 2013. “He said, ‘Keep this going. This is really important. This is the best chance we have.’” (Jeff Brown for The New York Times)

“One of my greatest disappointments”

One evening in April of this year, John Boehner settled into an armchair on an auditorium stage at Stanford University for one of his first public appearances since his resignation the previous September. Sitting opposite the Stanford historian David M. Kennedy, Boehner giddily unburdened himself of his feelings about his fellow Republicans. “It got to the point where I had to sneak into the White House,” he said, according to a recording provided by The Stanford Daily. “I’d walk to the White House, and the right-wing press would say, ‘Ooh, what deal is he going to cut?’ ” He railed at the “anything but yes group” in his caucus — “the knuckleheads.”

He said that he had been the one who first encouraged bipartisan talks on immigration reform years earlier, and that the House group “essentially had an agreement.” Yet, he said, the compromise was undone by his party. “There was no way the votes were there in the House to do it,” he said. “Believe me, I tried a dozen times to bring immigration reform to the floor. I got slapped down by my colleagues, slapped down by other leaders.” The failure to pass immigration reform, he said, was “one of my greatest disappointments.”

The event made headlines for Boehner’s frankness — at one point he called Ted Cruz “Lucifer in the flesh” — but his account of the immigration battle was notably incomplete. He failed to mention that he could, all along, have pushed harder to bring immigration reform to the floor had he merely been willing to skirt the Hastert rule.

By early 2014, Boehner was already planning to retire; if there had ever been an opportunity for statesmanship at little personal cost, this was it. And yet he could not bring himself to press forward with a legislative effort that he believed was in the best interest of his party and the country. “Our problem was not a substantive problem — it was a political problem,” says Muñoz, at the White House. “In the end, the coalition on the Hill which could pass a bill was going to consist of a lot of Democrats and probably not a majority of the Republicans. And the speaker never got to a place where that felt comfortable.” She added, “It takes a little bit of courage to overcome the political obstacles on the Republican side, and that courage did not manifest itself.”

But the administration and Democratic leaders made their own miscalculations. They had underestimated both the likelihood and the value of having a bipartisan bill emerge from the House. Their strategy had been informed by the ace they had waiting in their pocket: the executive action that Obama could, and did, authorize in the event of a stalemate on Capitol Hill. But this was a rickety scaffolding on which to build an immigration policy. In February 2015, a federal judge in Texas ruled in favor of that state’s challenge of the executive order. After the eight sitting Supreme Court justices split on the case in June, the judge’s injunction stands, and millions of families remain in limbo.

Not long before Boehner’s Stanford talk, I attended a Republican Party dinner at a Holiday Inn in Butler County, Ohio, Boehner’s home base in the Cincinnati exurbs, where the former speaker was making his postcongressional debut. As Boehner strode through a back hallway to the ballroom, I asked if he would care to take a few questions on immigration reform. “Oh, God, no,” he said. After the speech, he escaped through the kitchen to avoid any more encounters.

The top candidates to take Boehner’s seat were at the dinner. One had come out against birthright citizenship. Another had secured the endorsement of Butler County’s sheriff, Rick Jones, who is virulently opposed to illegal immigration; he posted a sign reading “Illegal Aliens Here” outside his jail and sent Mexico a $900,000 bill for immigrants he was holding there.

Sheriff Jones was at the event himself, with his brown dress uniform and walrus mustache. He had threatened to run against Boehner in the past. But Boehner was gone now, replaced as speaker by Paul Ryan, who was forced to swear off pursuing immigration reform as a condition for winning support from conservative members for his ascension.

The Breakdown Read more of ProPublica’s coverage of politics and lobbying in our ongoing series, The Breakdown.

The party had not merely failed to address the existential crisis laid bare by the 2012 election; it had lurched in the opposite direction, embracing Donald Trump, a nominee whose idea of Hispanic outreach was tweeting a picture of himself with a taco bowl on Cinco de Mayo. Speaking with Trump supporters in Ohio, I was struck by how thoroughly he had managed to fuse anxieties about border security and terrorism — my questions about immigration were often answered with references to ISIS and Syrian refugees rather than Mexicans. But what also struck me was the extent to which their frustration was aimed at Washington’s inability to get anything done, rather than at Republicans’ having conceded too much. Unwilling to risk a backlash against a controversial step forward, the party had ended up with a backlash against its own fecklessness.

At the Holiday Inn, Jones was excited to tell me about his role the next day as the introductory speaker at a rally just a mile away, for Trump. There, Jones would tell the crowd about his three trips to inspect the Mexican border. “Law enforcement, chiefs of police, we’re fed up, we get no help,” he would say. “Drugs are pouring in from the border.”

Jones had his own ideas for how to fix the problem, he said, but those weren’t needed just yet. “My job,” he told me, “is to get the crowd fired up.”

Read how the immigration issue plays out on the ground in Dayton, Ohio, and check out more of ProPublica’s coverage of politics in our ongoing series, The Breakdown.

This story is not subject to our Creative Commons license.

Alec MacGillis covers politics for ProPublica. MacGillis previously spent three years covering national politics for The New Republic and five years as a national reporter for The Washington Post. A resident of Baltimore, MacGillis is also the author of “The Cynic,” a 2014 biography of Sen. Mitch McConnell.

Opening illustration by Lincoln Agnew, special to ProPublica. Photo of Luis Gutiérrez by Alex Wong/Getty Images; John Boehner: Scott J. Ferrell/Congressional Quarterly via Getty Images; Paul Ryan: Tasos Katopodis/WireImage via Getty Images; Barack Obama: Yuri Gripas/AFP via Getty Images; Donald Trump: John Moore/Getty Images; Raul Labrador: Bill Clark/CQ Roll Call via Getty Images