Attorney General Maura Healey goes after Exxon Mobil, saying it lied to investors about climate change risks.

Massachusetts sued Exxon Mobil Corp on Thursday, with the state’s attorney general accusing the oil giant of misleading investors and consumers for decades about the role fossil fuels play in climate change.

Attorney General Maura Healey filed the suit shortly after the oil company lost a bid to delay the filing until after it is done defending itself in a trial over a similar lawsuit in New York.

Suffolk County Superior Court Judge Heidi Brieger, during a hearing in Boston acknowledged that Healey’s office was required to give Exxon an opportunity to discuss the case at least five days before suing the company.

But she ruled that the state was under no obligation to wait longer than that after notifying Exxon on October 10 of its intent to sue, which Assistant Attorney General Richard Johnston said his office wants to do “ASAP”, or as soon as possible.

“We should be allowed to file our lawsuit at the earliest possible moment,” he told the judge.

Exxon did not respond to a request for comment. In court papers, the company said Healey’s decision to sue now after a three-year investigation was simply “gamesmanship” to distract the oil company’s lawyers from the trial in New York that began on Tuesday.

Healey and her New York counterpart launched investigations into Exxon following news reports in 2015, saying company scientists determined that fossil fuel combustion must be reduced to mitigate the impact of climate change.

Those news reports, by InsideClimate News and the Los Angeles Times, were based on documents from the 1970s and 1980s. Exxon said the documents were not inconsistent with its public positions.

Healey, in 2016, issued a so-called “civil investigative demand” to Exxon seeking documents to determine whether it had violated the Massachusetts consumer-protection law through its marketing and sale of fossil fuel products.

The company fought the records request, but the state’s top court in April 2018 concluded Healey had jurisdiction to seek the records. In January, the United States Supreme Court declined to hear Exxon’s appeal of that order.

New York meanwhile sued Exxon in October 2018, accusing it of engaging in a scheme to deceive investors about the effect that future climate change regulations could have on its business.