Exxon Mobil (XOM) - Get Report won a major legal victory on Tuesday, with a New York court ruling in favor of the oil giant in a long-running suit that alleged Exxon had misled investors about the financial risk posed by climate change.

New York Attorney General Letitia James, who had filed the lawsuit last year, failed to prove that Exxon Mobil "had made any material misrepresentations that would have been viewed by 'a reasonable investor as having significantly altered the total mix of information made available,'" wrote New York Supreme Court Justice Barry Ostrager.

At the heart of the case was the contention that Exxon Mobil had defrauded investors by downplaying the risk to its business model from future regulation of the fossil-fuels sector in response to climate change, making its assets appear more secure than they really were.

But the lawsuit by New York's top law enforcement officer weakened as the three-week trial neared its end when the attorney general's office yanked two fraud charges. 

The remaining two were based on New York's Martin Act, which requires a significantly lower burden of proof, but even that was not enough.

Witnesses called by the attorney general's office were "eviscerated on cross-examination" by the expert witnesses Exxon Mobil rolled out for the trial, Ostrager said.

The judge also noted pointedly that the trial was not about climate change but about whether Exxon Mobil had committed securities fraud.

Investors mostly shrugged off the decision. Shares of Exxon Mobil were unchanged after hours after closing down 0.9% to $69.06 in the regular session.

"Lawsuits that waste millions of dollars of taxpayer money do nothing to advance meaningful actions that reduce the risks of climate change," Exxon Mobil said in a statement.