A federal judge handling ExxonMobil's dispute with the attorneys general of New York and Massachusetts has transferred the case about climate change from his court in Texas to one in New York. The decision marks a setback for the Dallas-based oil giant, which until recently had enjoyed a home court advantage before the bench of U.S. District Court Judge Ed Kinkeade.

Kinkeade has voiced sympathy with Exxon and skepticism over the attorneys general investigations into whether the company's climate record amounted to fraud.

The judge decided on Wednesday to send the case to New York because the foundation of Exxon's lawsuit rests on a press conference a year ago hosted by New York Attorney General Eric Schneiderman, who has been investigating Exxon under the state's powerful securities laws. At the highly publicized event, Schneiderman announced the formation of a coalition of attorneys general under the banner AGs United for Clean Power. The intent of the coalition was to hold Exxon and the fossil fuel industry accountable for climate change.

Exxon had been under investigation by New York for six months when Schneiderman announced the coalition. Massachusetts and the US. Virgin Islands opened investigations around the same time the coalition was formed.

Although Exxon had been cooperating with New York authorities, it filed lawsuits in Texas to halt the Massachusetts and Virgin Islands investigations. The Virgin Islands soon ended its investigation. Exxon later added New York to the lawsuit against Massachusetts.

"The merits of each of Exxon's claims involve important issues that should be determined by a court, however, this Court is not the proper venue to rule on the merits of Exxon's claims," Kinkeade wrote in his transfer order.

The case has been assigned to U.S. District Judge Valerie E. Caproni who serves on the Southern District Court of New York in Manhattan. The 61-year-old judge was appointed to the bench by Barack Obama in 2013. Prior to her appointment, Caproni served as chief of the criminal division for the U.S. Attorney's Office in the Eastern District of New York.

In surrendering the case that he has overseen for nearly a year from his Dallas courtroom, Kinkeade issued an 11-page preamble to his order reciting a series of points that Exxon has emphasized in its efforts to discredit the state investigations.

And he made a point of noting the oil company's position on climate change in the past ten years.

Kinkeade, who was appointed to the federal bench by former president George W. Bush in 2002, said he suspects Schneiderman and Massachusetts Attorney General Maura Healey were motivated to open inquiries in the wake of an investigative series of stories first by Insideclimate News and later by the Los Angeles Times that disclosed Exxon was aware of the consequences of climate change as early as 1977.

"The Court is uncertain if it is common practice for attorneys general to begin to investigate a company after reading an article that accuses a company of possibly committing wrongdoing decades ago," Kinkeade wrote.

"What the Court does know is that Exxon has publicly acknowledged since 2006 the possible significant risks to society and ecosystems from rising greenhouse gas emissions, yet the attorneys general have only recently felt compelled to look further into Exxon's documents from the last 40 years to see if Exxon knew more than it shared with the public and investors about climate change."

Kinkeade further questioned whether the investigations were intended to "squelch public discourse by a private company that may not toe the same line as these two attorneys general."

The judge meticulously listed Exxon's arguments, including its assertions of violations of its First Amendments rights and abuse of power by the attorneys general.

While he carefully attributed each claim to the company, his sympathies were unmistakable. And his narration of Exxon's arguments drew a sharp rebuke from Schneiderman's office.

"The order is riddled with factual errors and oil industry spin," said Amy Spitalnick, a spokeswoman for Schneiderman, who subpoenaed Exxon for records in 2015.

"The judge appropriately decided that Exxon's case should not be heard in Texas," she said. "We will continue to pursue our investigation under New York law, ignoring Exxon's continued campaign of delay and distraction."

Healey's office declined to address Kinkeade's remarks, saying only that Texas was not the proper place to fight.

"As we have made clear time and again, Exxon, like other companies we investigate, is subject to Massachusetts laws, and we will continue to argue that this frivolous lawsuit should be dismissed," said Healey spokeswoman Chloe Gotsis.

Exxon spokesman Alan Jeffers did not respond to a request for comment.

The transfer comes just days before Exxon must explain to a New York State judge why it failed to turn over emails between former Exxon chief executive Rex Tillerson and five other Exxon executives as part of the New York investigation. Investigators recently discovered Tillerson was using a shadow email under the name Wayne Tracker to discuss climate change issues.

The New York and Massachusetts investigations focus on whether past statements by Exxon questioning climate change science and downplaying its risks to the company constituted a form of fraud against its shareholders or the public.

Those investigations provoked a furious response by Exxon that landed in Kinkeade's lap last year when the company filed a lawsuit to derail first the Massachusetts investigation and later the New York investigation. (Litigation also is pending in local courts in both New York and Massachusetts.)

Healey and Schneiderman have argued Exxon lacked jurisdiction to fight the case in a Texas court because it was the improper to sue them outside of their jurisdictions. Filing the case in Texas amounted to forum shopping in the hopes of finding a sympathetic judge, they maintained.

In an unprecedented ruling last year, Kinkeade ordered Healey and Schneiderman to appear for depositions under questioning by Exxon lawyers. Kinkeade justified the order by saying he thought Healey, especially, had acted in bad faith.

Kinkeade's lengthy narrative was likely meant to telegraph his position to the federal district court for the Southern District of New York, in Manhattan, said Tom McGarity, a University of Texas law professor.

"It has the feel of Judge Kinkeade tipping his hand," McGarity said. "He is signaling to New York to look at this case very closely."

But transferring the case to New York makes a "world of sense," McGarity said.

"There is more going on in New York over this than in Dallas."