Exxon Mobil misled the public about climate change for years even as its research echoed the growing scientific consensus that global warming is real and caused by human activity, a new study finds.

The conclusion is based on a study by two Harvard University researchers, who used social science methods to compare what Exxon Mobil said in nearly 200 scientific publications and internal communications on climate change with what they presented in three dozen advertisements over 15 years.

The researchers' takeaway is that the more publicly available advertisements sowed doubt that climate change is real and caused by humans, while the scientific studies and private exchanges more openly acknowledged that scientific fact.

"We conclude that ExxonMobil contributed to advancing climate science — by way of its scientists' academic publications — but promoted doubt about it in advertorials. Given this discrepancy, we conclude that Exxon Mobil misled the public," the researchers wrote.

The findings potentially add grist to the mill as a number of attorneys general, including New York's Eric Schneiderman, continue to investigate whether Exxon misled shareholders. The Securities and Exchange Commission is also probing how the oil major values its fossil fuel reserves in light of global warming.

"As detailed in our filings in New York court, the Attorney General's investigation of Exxon Mobil has uncovered significant evidence indicating that Exxon may have misled New York investors and consumers about the risk of climate change to the company," Amy Spitalnick, press secretary for the New York State Office of the Attorney General told CNBC.

"We will continue to vigorously pursue our investigation, regardless of Exxon's unprecedented campaign of delay and distraction."

The Harvard researchers, Geoffrey Supran and Naomi Oreskes, presented their findings in a peer-reviewed article in the journal Environmental Research Letters. In a New York Times op-ed, they said they were inspired to apply empirical analysis to the documents after investigations by Inside Climate News and the Los Angeles Times put forward the notion that Exxon obscured what it long knew about climate change.

One key finding is that Exxon acknowledges that climate change is real and human-caused in 83 percent of peer-reviewed papers and 80 percent of internal documents. Yet 81 percent of editorial-style advertisements placed in the New York Times from 1989 to 2004 express doubt.

"In short, Exxon Mobil contributed quietly to climate science and loudly to raising doubts about it," Supran and Oreskes said in the op-ed.

A March 2000 advertorial by Exxon opens this way: "Knowing that weather forecasts are reliable for a few days at best, we should recognize the enormous challenge facing scientists seeking to predict climate change and its impact over the next century."

The Harvard report was funded by the Rockefeller Family Fund, which has supported other work to reveal what Exxon knew about climate change and what it publicly disclosed.

"The study was paid for, written and published by activists leading a five-year campaign against the company. It is inaccurate and preposterous," Exxon Mobil said in a statement.

"The study claims that Exxon Mobil advertorials in the New York Times cast doubt on climate science, which is the researchers' opinion and not supported by fact," the company added, noting its advertisements pointed to potential risks associated with climate change.

CNBC contacted about a dozen of Exxon Mobil's largest investors. They either declined to comment or did not respond.

Exxon Mobil shareholders recently approved a nonbinding proposal that asked Exxon to disclose the impacts to its business of global climate goals enshrined in the Paris climate agreement, which seeks to prevent temperatures from rising by more than 2 degrees Celsius above pre-industrial levels.

Baldwin Brothers, a wealth management firm with $800 million of assets under management, has been lobbying Exxon to disclose risks to its business related to climate change since 2014. Managing Director Dylan Sage said he grew concerned that policies aimed at mitigating global warming would leave much of Exxon's reserves stranded in the ground.

"We wanted to have a better framework to understand under that scenario how much equity of ours is at risk," he said.

"Subsequently, we've gotten out of a lot of our Exxon shares when they wouldn't take seriously the risks to their business model around a low-carbon scenario," he said.