A superior court judge ruled Wednesday that ExxonMobil must turn over 40 years worth of documents related to the company’s study of the environmental impact of carbon emissions. The ruling is part of an ongoing lawsuit against ExxonMobil filed by Massachusetts Attorney General Maura Healey.

ExxonMobil had tried to block Healey’s demand, arguing she didn’t have jurisdiction, but a Suffolk County Superior Court judge sided with Healey.

The attorney general alleges ExxonMobil deceived investors and consumers by hiding what it knew about fossil fuels and climate change.

“In this order directing Exxon to comply with our investigation, the court affirmed the longstanding authority of the attorney general to investigate fraud,” a spokeswoman for Healey said in a written statement. “Exxon must now end its obstructive tactics and come clean about whether it misled Massachusetts consumers and investors about what it knew about climate change, its causes and effects.”

 “She has to be the cop on the beat to make sure the law is enforced, and that is precisely what she is doing,” Conservation Law Foundation president Brad Campbell said. The organization is currently embroiled in its own similar lawsuit with Exxon Mobil. “And we should all breathe a sigh of relief that ExxonMobil failed in its bid to be protected from regular law enforcement.”

“We’re very interested to see where ExxonMobil’s deceit about climate science might have resulted in violations of law and endangerment of public health or safety,” he said.

ExxonMobil will likely appeal the ruling, according to WGBH legal analyst Daniel Medwed.

“[E]ven if ExxonMobil is ordered ultimately to disclose all these documents, there are going to be these small-scale skirmishes over the content of those documents, where Exxon will try to try to redact certain information as proprietary or sensitive, and it’s going to be a very protracted process,”Medwed said.

ExxonMobil is reviewing the decision to determine its next steps, a spokesperson said.