A federal judge on Thursday threw out ExxonMobil's lawsuit that sought to derail New York and Massachusetts' probe into whether the oil giant misled investors and the public about its knowledge of climate change.

Exxon tried to convince U.S. District Court Judge Valerie A. Caproni that New York Attorney General Eric Schneiderman and Massachusetts Attorney General Maura Healey were infringing on the company's free speech rights and the AGs were pursuing politically motivated investigations.

But in a searing ruling, Caproni called the company's claims "implausible" and "a wild stretch of logic."

"The relief requested by Exxon in this case is extraordinary: Exxon has asked two federal courts—first in Texas, now in New York—to stop state officials from conducting duly authorized investigations into potential fraud," she wrote. "It has done so on the basis of extremely thin allegations and speculative inferences."

Exxon's allegations rested on statements made at the AGs' United for Clean Power press conference in March 2016. The company tried to paint Schneiderman and Healey's participation in the event as a evidence of their political bias against the company.

However, Caproni dismissed that argument, which she considered a result of "cherry-picking snippets from the transcript of the press conference."

"Some statements made at the press conference were perhaps hyperbolic, but nothing that was said can fairly be read to constitute declaration of a political vendetta against Exxon," she wrote.

The company's claims that the AGs "are pursuing bad faith investigations in order to violate Exxon's constitutional rights are implausible," the judge continued.

Healey said, "Exxon has run a scorched earth campaign to avoid answering our basic questions about the company's awareness of climate change. Today, a federal judge has thoroughly rejected the company's obstructionist and meritless arguments to block our investigation."

Caproni dismissed the lawsuit with prejudice, meaning Exxon cannot file it again.

Schneiderman and Healey celebrated the ruling.

"I am pleased with the court's decision to dismiss Exxon's frivolous, nonsensical lawsuit that wrongfully attempted to thwart a serious state law enforcement investigation into the company," Schneiderman said.

"At every turn in our investigation, Exxon has tried to distract and deflect from the facts at hand. But we will not be deterred: our securities fraud investigation into Exxon continues."

"This is a turning point in our investigation and a victory for the people."

Exxon’s lawsuit to stop our investigation into what the company has known about the impact of burning fossil fuels was just dismissed in New York. pic.twitter.com/lYJ2398NtY — Maura Healey (@MassAGO) March 29, 2018

Exxon spokesman Scott Silvestri told Reuters the company is evaluating its legal options.

"We believe the risk of climate change is real and we want to be part of the solution," he added. "We've invested about $8 billion on energy efficiency and low-emission technologies such as carbon capture and next generation biofuels."