An attorney for Sheldon Adelson’s Las Vegas Sands Corp. called the new Justice Department opinion “well reasoned” and “fastidiously researched.” Here, Adelson is seen at the White House in November 2018. (Andrew Harnik/Associated Press)

The Justice Department’s decision last month to release a legal opinion that could further restrict Internet gambling is drawing fire from state attorneys general and former department officials amid questions about casino magnate Sheldon Adelson’s long-standing push for the move.

The legal opinion, which was posted online during the partial government shutdown, reversed a 2011 Justice Department interpretation of the Wire Act that effectively gave the states a green light to authorize lotteries and other forms of online gambling.

The change was long sought by Adelson, a major Republican donor who spent more than $20 million to back Donald Trump’s campaign in 2016.

“We can see no good reason for the Justice Department’s sudden reversal,” Josh Shapiro, attorney general of Pennsylvania, and Gurbir S. Grewal, attorney general of New Jersey, wrote this week in a joint letter to acting U.S. attorney general Matthew G. Whitaker and Deputy Attorney General Rod J. Rosenstein.

In their letter, the Democratic attorneys general said they were concerned by reports that the drafting of the new opinion “followed substantial lobbying by outside groups.”

The opinion released Jan. 14 by the Justice Department’s Office of Legal Counsel (OLC) echoed arguments outlined in a memo written by the law firm of Washington attorney Charles Cooper, who was working as part of an Adelson-backed lobbying team. Cooper’s memo reached the OLC in 2017, officials confirmed.

Cooper himself is a former head of the OLC and has worked as a personal lawyer for former attorney general Jeff Sessions.

In an interview, Cooper confirmed that he lobbied Justice Department officials to reconsider its previous opinion on the Wire Act and expressed satisfaction that his memo resonated with his successor.

The opinion “accords entirely with the analysis my firm undertook and I shared with the DOJ,” said Cooper, who compared his memo to law review articles and opinion pieces that serve as research material for department lawyers.

Justice Department officials said the process that led to the new opinion was independent and in keeping with department norms and guidelines.

“The 23-page opinion reflects the Office of Legal Counsel’s best judgment of the law, and the accusation that the opinion was shaped by any outside interest is baseless and offensive,” said Nicole Navas Oxman, a Justice Department spokeswoman.

The opinion centers on an interpretation of the Wire Act, a 1961 statute that makes it a criminal offense to transmit information to promote interstate or foreign wagering.

In September 2011, the Obama Justice Department issued an opinion that only sports betting fell within the purview of the act.

The reversal of that decision could have an impact on interstate lotteries and has upset state officials, who have come to rely on lottery revenue to fund key programs.

In their letter this week, the state attorneys general argued that the opinion “tramples over the law and states’ rights . . . to upend the settled expectation on which we have been relying of near a decade.”

It also rankled gambling companies, who see online wagering as a growth market and a way to compete with Adelson’s bricks-and-mortar casino empire.

Adelson has previously promised to “spend whatever it takes” to block online gambling. He has said he is acting out of concern for the welfare of young people and economically vulnerable citizens who could fall prey to the lure of online gambling.

The casino magnate and his top congressional allies have long called for a reversal of the Justice Department’s 2011 opinion. Sessions said at his 2017 confirmation hearing that he would to look into the interpretation of the Wire Act.

Adelson is a top ally of Trump. In October, he and his wife Miriam contributed $500,000 to a fund set up to help pay legal expenses incurred by aides to the president drawn into the Russia investigation, tax records show. The following month, Trump awarded Miriam Adelson the Presidential Medal of Freedom, the highest civilian honor.

The new Justice Department opinion was dated Nov. 2, 2018, and publicly released Jan. 14.

At the time, a Justice Department official told The Post that said the OLC did not have discussions about the opinion with Adelson or “any outside parties.”

Another Justice Department official acknowledged this week that Cooper’s memo making the case for overturning the 2011 opinion was provided to officials in the criminal division on April 24, 2017, and subsequently shared with the OLC.

The official said submissions from outside parties on such topics are not uncommon or inappropriate, saying that lawyers representing New York state sent their own memo to the Justice Department before the 2011 opinion.

The Justice Department’s latest opinion “reflects the independent legal judgment of the Office and cites the legal authorities that it relied upon in reaching its conclusions,” said the official, speaking on the condition of anonymity to describe internal discussions.

Darryl Nirenberg, an attorney and lobbyist for Adelson’s Las Vegas Sands Corp., called the new Justice Department opinion “well-reasoned” and “fastidiously researched.”

“It appears to be crafted to stand the tests of the judiciary,” he added. Nirenberg worked closely with Cooper, who was lobbying on behalf of the Adelson-backed Coalition to Stop Internet Gambling.

However, other legal experts disagreed, saying they were not persuaded by the arguments in the opinion by Assistant Attorney General Steven A. Engel, who leads the OLC.

“I haven’t seen any evidence that Assistant Attorney General Engel acted improperly, or that he didn’t sincerely believe what he wrote in the opinion; even so, I don’t find it as persuasive as the 2011 opinion — only the former makes functional sense of the statute — and, more importantly, the new opinion doesn’t offer any compelling reason for revisiting, let alone overruling, the 2011 opinion,” said Martin Lederman, a former top OLC official.

Other department veterans said the decision to release the new opinion during the partial government shutdown was un­or­tho­dox, noting that only activities that impact public safety are typically authorized.

“It is unclear to me how this kind of work could meet the very stringent standards for review” during a shutdown, said Dawn Johnsen, who was acting director of the division during a government shutdown in the mid-1990s.

Justice Department officials said the release of the decision was consistent with rules that “authorize limited public releases related to the enforcement of the criminal laws.”

Democrats on the House Judiciary Committee have also questioned the department’s new reading of the Wire Act and said they may raise the issue with Whitaker on Friday, when he is set to testify on the Hill.

“I was quite stunned to see this dramatic U-turn by OLC,” said Rep. Jamie B. Raskin (D-Md.), an American University law professor elected to Congress last year, calling it “an outrageous, deliberate misreading of the statute.”

However, Sen. Lindsey O. Graham (R-S.C.), the chairman of the Senate Judiciary Committee who has pushed for legislative language to overturn the 2011 opinion, praised the move.

“Restoring the original interpretation of the Wire Act takes great strides to protect children and society’s most vulnerable,” Graham said last month. “It will also be a blow to criminal elements that tried to take advantage of the failed Obama policy.”