On the day after Barack Obama’s reëlection last November, the staff at the Heritage Foundation, the conservative think tank, gathered in an auditorium at its well-appointed headquarters, a few blocks from Congress. Edwin J. Feulner, who co-founded the organization in 1973, and served as its President until this year, addressed his demoralized employees.

“Many of you may be looking around in despair and asking, ‘Where is the cavalry that can come galloping to the rescue and save us from disaster?’ ” he said, according to a hagiographic new book about Feulner and Heritage.

“This time around we are the cavalry,” he said. “We are the flagship conservative organization that carries on the Reagan legacy. We are the people conservatives look to stop the Obama revolution in its tracks.”

This week, though Feulner recently stepped down—he was replaced by Jim DeMint, the Tea Party champion and Senator from South Carolina who left office to take the job —Heritage tried to make good on his promise. The think tank released a report about the immigration bill now making its way through Congress. The bill, a product of delicate negotiations among four Republicans and four Democrats, would create a process by which the estimated eleven million undocumented immigrants in the United States could eventually become American citizens. The authors of the Heritage report reached a shocking conclusion about this policy, which they dubbed “amnesty”: the Senate bill would cost the federal government $9.4 trillion in government benefits, all of which would be bestowed on these new citizens, who would pay only $3.1 trillion in taxes, for a net loss of $6.3 trillion. It said that this was a “minimum estimate” and added, “some argue that it does not matter whether unlawful immigrants create a fiscal deficit of $6.3 trillion because their children will make up for these costs. This is not true.”

Heritage had reason to believe that its new report could help sink the legislation, which entered a precarious period this week as it gets debated at the committee level. In 2007, the last time Washington attempted to pass comprehensive immigration reform, Heritage responded with a similar study that memorably (and dubiously) reported that the household of every new illegal immigrant who became a United States citizen would cost the government twenty-one thousand dollars a year in welfare. The think tank ran radio ads that featured the sound of a car engine and an announcer who said “That’s like buying them a brand-new Mustang convertible each year.”

Heritage’s 2007 campaign against immigration came at a turning point for the group. For much of its history, Heritage fashioned itself as a quasi-academic institution. Its specialty was providing serious policy ideas to Republican legislators and Presidents. There was always a political component to its work, but during the Reagan years, Heritage gained a reputation as an intellectual powerhouse. “In the 1960s it looked as if universities would establish a monopoly over the life of the mind, providing policies for politicians, sinecures for writers, ideas for journalists, and breakthroughs for industrialists,” The Economist said in 1993. “The 1980s changed all that. Governments in search of advice looked to think tanks such as the Institute of Economic Affairs in Britain and the Heritage Foundation in the United States, rather than to Oxford or Harvard.”

In 2007, as the immigration debate began, Feulner officially changed Heritage’s focus. In remarks to the group’s board of trustees that April, he explained that back in the seventies and eighties, Congressmen “needed the facts, information, and data. Today, conservative members of Congress have the information, but too often they seem to lack the will to do the right thing.” He proposed transforming Heritage from a genteel place that provided sound policy to a pressure group that would enforce conservative orthodoxy. “It is no longer enough to provide policymakers with the right ideas,” he said. “They must be encouraged by the public to implement them.”

The 2007 attack on the immigration bill was Heritage’s first foray with its newly aggressive posture. It started advertising on conservative radio—Sean Hannity, Laura Ingraham, Rush Limbaugh—and four years later, Feulner started Heritage Action for America, a lobbying group that hoped to force Republican lawmakers to adopt Heritage ideas. Since then, the group has become a major source of irritation to Republican leaders. Earlier this year, an aide to Majority Leader Eric Cantor told me House Republicans were often exasperated with how difficult the group made their jobs. One of the leaders of Heritage Action told Lee Edwards, the author of the Feulner biography, that Republican leaders told Heritage they were “unreasonable and never want to compromise.” Heritage’s transformation from a boring Washington policy shop to a populist pressure group was completed in January, when DeMint took over.

DeMint no doubt hoped that this week, when Heritage released its updated version of the 2007 report, the document would have a similar impact on the immigration debate. Instead, something very different happened: Republican officials and conservative writers tore the report to shreds, criticizing it for its shoddy analysis and intellectual dishonesty.

Larry Kudlow, a cable-news host, asked one of the authors of the study, “Did you calculate economic benefits from immigrants?” He answered that he had not.

Haley Barbour, the former governor of Mississippi, said the report was “a political document” and “not a very serious analysis.” At the libertarian Cato Institute, Heritage’s sometime rival, the analyst Alex Nowrasteh said that the study was essentially worthless. “I criticized an earlier version of this report in 2007,” he wrote, “arguing that their methodology was so flawed that one cannot take their report’s conclusions seriously. Unfortunately, their updated version differs little from their earlier one.” He added, “Its flawed methodology and lack of relevancy to the current immigration reform proposal relegate this study to irrelevancy.” The authors simply made estimates—wild guesses, really—about the benefits earned and taxes paid over the lifetimes of immigrants who would earn citizenship under the law, and then added it all together to get the enormous multi-trillion-dollar figure. They ignored any other economic benefits from immigration that might offset the costs they tallied up, while making dismissive assumptions about their potential social and educational attainments.

The Heritage report and the reaction to it was a major event on the road to immigration reform. The overwhelming majority of the conservative movement has been united in opposition to the Obama agenda. But on immigration reform, something very unusual is happening. The Republican elite has decided to take on the grassroots of the party in a battle that will undoubtedly redound to Obama’s benefit.

Whether G.O.P. leadership’s impetus for championing this fight is a calculation about declining support from Hispanic voters or the pressure of business interests that favor immigration reform—the two most widely cited reasons—we are witnessing a rare event in our current politics: the Republican Party betraying its most passionate supporters to help give President Obama a historic victory. Edwin J. Feulner can’t be happy.

Photograph of former Heritage Foundation President Edwin J. Feulner, by Win McNamee/Getty.