WASHINGTON — Four years ago in New Hampshire, campaigning for the Republican presidential nomination, John McCain said to voters, “I do agree with the majority of scientific opinion, that climate change is taking place and it’s a result of human activity, which generates greenhouse gases.” He made global warming a key element of every New Hampshire stump speech.

This week in New Hampshire, the governor of Texas and newest presidential contender, Rick Perry, said scientists have manipulated data to support their “unproven” theory of human-influenced global warming. He said increasing numbers of scientists have disavowed the theory altogether.

This is not simply a case of two very different politicians saying two very different things. The political discussion about global warming has lurched dramatically in four years — even as the scientific consensus has changed little. McCain’s 2007 description remains the scientific consensus: Human activity, including the burning of fossil fuels, is pumping carbon dioxide and other greenhouse gases into the atmosphere and warming the planet.

But that scientific conclusion has become a political debating point. Joining Perry on the skeptical side, for example, is Rep. Michele Bachmann, R-Minn., who suggested Wednesday that “manufactured science” underpins what a questioner called the “man-made climate change myth.”

The nominal GOP front-runner, Mitt Romney, drew sharp conservative fire when he said in June that he accepts the scientific view that the planet is getting warmer, and that humans are part of the reason. Former Utah governor Jon Huntsman on Thursday tweeted: “To be clear. I believe in evolution and trust scientists on global warming. Call me crazy.”

“Climate change has become a wedge issue,” said Roger Pielke Jr., a University of Colorado professor who has written extensively on the climate debate. “It’s today’s flag burning or today’s partial-birth abortion issue.”

Historically climate change has ranked near the bottom of issues that voters care about as they evaluate presidential candidates. It failed to be a factor in the 2008 presidential race either in the primary season or in the general election. The major parties’ nominees endorsed the scientific consensus and believed the government should curb carbon emissions.

But even as it appeared that the government might take sweeping action on climate change, the political opposition intensified. President Barack Obama favored a nationwide system in which industries would have to cap their carbon dioxide emissions and trade pollution allowances with one another. The then-Democrat-controlled House passed this “cap-and-trade” system in June 2009, but the plan stalled in the Senate after Republicans and major industries criticized it as a “cap-and-tax” system that would escalate energy costs.

The battleground shifted to the Environmental Protection Agency, which in December 2009 determined that greenhouse gases pose a threat to public health and welfare. That “endangerment finding” paved the way for regulating carbon dioxide as a pollutant under the Clean Air Act. GOP lawmakers and industry groups fought the plan, calling it a job-killing tax and an example of government overreach.

Some in the tea party seized on the issue as a rallying cry in last year’s election, which brought dozens of new members to Congress who reject a connection between human activity and climate change.

Missteps by scientists have given critics ammunition. Most notorious were “Climate-gate” e-mails hacked from computers at the Climate Research Unit of the University of East Anglia in Britain in 2009. The e-mails showed scientists being combative and clubby, but multiple investigations in both the U.S. and Britain cleared the researchers of scientific misconduct, concluding that there was no evidence that they tried to cook the books, as critics had alleged.

Embarrassing errors were also found in a seminal 2007 report by the United Nations Intergovernmental Panel on Climate Change, which was supposed to establish beyond question the scientific consensus. One passage in the 3,000-page report, for example, stated that massive glaciers in the Himalayas would vanish by 2035 — which isn’t true.

Such missteps revealed that the scientific establishment does not always function like a well-oiled machine, and that climate science in the raw is a more contentious enterprise than the average academic press release might suggest. But the errors did not change the basic science behind the theory of anthropogenic (human-caused) global warming.

That the planet has warmed is a fact hardly anyone disputes — it’s been measured with instruments on land and sea and in space. That humans have contributed to the warming through industrial activities is a theory supported by multiple scientific organizations, including the National Academy of Sciences, the American Association for the Advancement of Science, the U.S. Global Change Research Program, the National Oceanic and Atmospheric Administration (NOAA) and NASA.

“Ultimately we go back to physics. If you burn fossil fuel you make CO2,” said Richard B. Alley, a geophysicist at Penn State University and author of “Earth: The Operator’s Manual.” “You can do this with bookkeeping. How much did we burn, how much CO2 does that make, where is it? There it is.”

One of the twists in the debate is that the scientific data that show the planet warming over the past century {ndash} data that skeptics often deride as untrustworthy — also show that the rate of warming has slowed in the past decade or so. “The warming has slowed since 1998,” said Tom Peterson, chief scientist for NOAA’s National Climatic Data Center.

The most recent decade is still the warmest on record — warmer than 1990s, which were warmer than the 1980s. And both NOAA and NASA rate 2010 as tied, with 2005, for the warmest year ever measured.

But the flattening of the trend has inspired skeptics to declare that global warming is over, or that these are natural fluctuations that aren’t driven by human activity. Scientists say that’s hardly the case, saying multiple factors are dampening the warming trend, including sunlight-blocking volcanic aerosols and soot emitted from China’s proliferating coal-fired power plants. And they stress that the effects of greenhouse gases build over time.

“The full impact of the greenhouse gases that we’ve already added to the system today won’t be felt for 20 or 30 years,” said Bill Chameides, dean of the Nicholas School of the Environment at Duke University and co-author of a recent National Academy of Sciences report, “America’s Climate Choices.”

When Chameides and his colleagues began their research in 2008, they assumed they’d have to rush to finish before the government took action on climate change. Instead, they watched the political landscape change as “Climategate” and other controversies incited public doubts about climate science. They delayed their report in order to take a fresh look at the research in its totality.

Their conclusion is stated in the report’s first sentence: “Climate change is occurring, is very likely caused by human activities, and poses significant risks for a broad range of human and natural systems.”

There are dissenting scientists, but they’re a small minority within the climate-science community. A 2010 study in the Proceedings of the National Academy of Sciences surveyed 1,372 climate scientists and found that 97 percent to 98 percent agreed that humans were contributing to global warming.

The general public is far more divided. A Pew Research Center poll published in October 2010 showed, that, over the previous four years, the number of respondents believing there is “solid evidence” that the Earth is warming dropped from 79 percent to 59 percent. There was a dramatic divide along partisan lines: Some 79 percent of Democrats believed in global warming, compared with only 38 percent of Republicans.

A Washington Post/ABC News poll in November 2009 found conservative Republicans were least likely to believe global warming was occurring, with 45 percent saying it was happening. That represented a 20 percentage point drop from the previous year.

Influential conservatives have pushed climate science to the fore of Republican politics. When Romney endorsed the consensus scientific view, talk radio titan Rush Limbaugh immediately declared, “Bye-bye, nomination. Another one down.”

Climate change, says Marc Morano, the publisher and editor of the skeptical Web site Climate Depot, is “a litmus test, pure and simple, for the presidential race.”