A Suffolk Superior judge on Thursday dismissed a lawsuit filed by the City of Boston to stop a $1.7 billion casino, delivering a stunning blow to Mayor Martin J. Walsh’s efforts to prevent the gambling resort from being built in the neighboring city of Everett.

In a 24-page ruling, Judge Janet L. Sanders wrote that the state Gaming Commission had acted properly in issuing a casino license to Wynn Resorts.

“The undisputed facts show that the commission did not violate either the Gaming Act or its regulations,” Sanders wrote. “The upshot is that the entire complaint must be dismissed.”

City officials, who have already spent more than $1 million on the litigation, said Thursday night that they are “currently reviewing the judge’s order and weighing options to appeal.’’

Advertisement

Walsh has been fighting the project for months, investing considerable political capital in his dogged attempt to block construction of a 24-floor, curved glass tower on the Mystic River waterfront, a short distance from Boston’s Charlestown neighborhood. He argued that the new casino will further snarl traffic in already-congested Charlestown.

The dismissal is the latest twist in a protracted and, at times, nasty dispute between Walsh and casino mogul Steve Wynn.

“We are very pleased with Judge Sanders’s ruling, the result of which continues the positive momentum of our development,” Wynn Resorts said in a statement to the Globe.

Wynn Resorts had competed against Mohegan Sun and the Suffolk Downs race track for the sole Greater Boston license. Mohegan Sun, which had made a generous financial agreement with the City of Boston, would have operated a casino on the Revere portion of Suffolk Downs.

Elaine Driscoll, a spokeswoman for the state gambling commission, the defendant in the suit, called the decision “a validation of the hard work and detailed effort put forth by the commission and its staff.”

Advertisement

“We are hopeful that Wynn and the cities of Boston and Revere can now begin to reconcile their differences through open dialogue and negotiation as opposed to legal action,” Driscoll said.

The judge also dismissed Revere’s lawsuit against the gambling commission, ruling that the city had no right to sue.

“When Wynn was awarded the casino license,” Sanders wrote, “the only harm Revere suffered was the loss of potential economic benefits it may have received had Mohegan [Sun] been the winning applicant.”

In her ruling, Sanders wrote that Boston failed in all 10 counts contained in its 150-page complaint alleging wrongdoing by the gambling commission.

She chided Boston and its lawyers for “inflammatory descriptions,” “spurious” claims and “hyperbole” that “tend only to obscure the factual allegations.”

Moreover, the City of Boston had failed to show it had suffered the kind of injury that under the Gaming Act would have allowed it to pursue its lawsuit.

Though the city alleges a litany of violations and costly damages to Boston, she wrote, affecting traffic, the environment, and public safety, she could not “see how these alleged irregularities impacted Boston much less caused it to suffer any injury sufficient to give it standing.”

Boston Mayor Martin J. Walsh (center) held a press conference in May at a site along Alford Street near Sullivan Square to discuss the city's amended complaint against the Massachusetts Gaming Commission.(Barry Chin/Globe Staff)

Sanders rejected the city’s contention that every decision related to the license should be nullified.

The city had argued that commission chairman Stephen P. Crosby’s decisions were tainted by what they called violations of the conflict-of-interest law. These included allegations that he had improper communications with Wynn and that he was biased because one of the former owners of the land where Wynn is building his casino was Crosby’s former business partner.

Advertisement

Sanders had strongly indicated that she was skeptical of the city’s right to challenge the Gaming Commission’s decision at a September hearing. With her decision looming, the two sides have been meeting quietly in recent weeks in an effort to resolve their differences, according to a person briefed on the meetings.

Should Walsh and Wynn come together, they would likely need to resolve the city’s concerns about the traffic the casino is expected to generate in Sullivan Square in Charlestown.

Walsh’s deal with Mohegan Sun for the Revere casino would have handed the City of Boston a one-time payment of $30 million plus $18 million annually. Wynn had offered Boston a one-time payment of $6 million and $2.6 million a year, which Walsh rejected.

After the Gaming Commission chose Wynn’s proposal, the City of Boston, joined by Somerville and Revere, filed a suit alleging that the commission intentionally violated state laws and rules to make sure it awarded the license to Wynn.

Lawyers for Somerville had earlier asked the judge to postpone ruling on their case.

In their suit, Boston lawyers sought to subpoena two former State Police troopers who were allegedly allowed into a secure room in the attorney general’s office to review confidential files.

Advertisement

The city asserted that those two retired troopers were working on behalf of Wynn and were given access to investigatory files related to Charles Lightbody, a felon who owned a piece of the property where Wynn Resorts is planning to build the casino.

Sanders denied the subpoenas and Wynn sued for defamation because information about the subpoenas was published in the Globe.

Preliminary work has begun at the planned site of the Wynn casino in Everett.(John Blanding/Globe Staff)