The Securities and Exchange Commission has decided to stop investigating Exxon Mobil over whether the oil and gas giant misled investors by not accounting for the impact that climate change has on its business.

The SEC, an independent government agency, informed Exxon that it closed the two-year probe, according to a letter obtained by the Wall Street Journal.

Exxon confirmed the SEC told the company it is ending the investigation.

“After a thorough investigation, including a review of these documents, the SEC issued its closure letter,” Exxon spokesman Scott Silvestri said. “We are confident our financial reporting meets all legal and accounting requirements.”

Under U.S. law, public companies must tell shareholders about risks or uncertainties related to their business. In Exxon's case, its oil and gas operations emit greenhouse gas emissions, and thus contribute to climate change.

Despite the SEC’s decision, Exxon still faces probes from the attorneys general of New York and Massachusetts about whether Exxon’s public statements about climate change misled investors.

Exxon and other oil and gas companies are also being sued by various cities for their handling of climate change, but have been successful so far in fending those off.

A federal judge last month dismissed New York City’s lawsuit against major oil companies for their contribution to climate change, the latest in a string of suits filed by cities to be tossed aside.

Cities, including San Francisco and Oakland, have argued that big oil companies have promoted fossil fuel use and deliberately concealed that they knew climate change could harm coastal cities, meaning they should have to pay for seawalls and other infrastructure to protect against rising sea levels.

Oil companies say that courts cannot rule on broad and speculative issues such as the impact of business decisions on climate change.