Judge Victor Marrero in New York said he believed the new T-Mobile would continue to compete aggressively with Verizon and AT&T, the industry giants whose size it now rivals. T-Mobile, the No. 3 U.S. phone company, has been known for such consumer-friendly, industry-shattering measures as abolishing two-year service contracts and restoring unlimited data plans.

Though the deal still needs a few more approvals, T-Mobile expects to close it as early as April 1.

T-Mobile has promised not to raise prices for three years and said “efficiencies” it gets from a more powerful network will translate to lower prices down the road. T-Mobile also argued that the combined T-Mobile and Sprint would be able to build a better next-generation, 5G cellular network than either company could alone.

But more than a dozen state attorneys general had sued to block the deal, saying one fewer phone company, even a smaller rival like Sprint, would cost Americans billions of dollars in higher bills. One of the leading parties, New York Attorney General Letitia James, said her office was considering an appeal. She said Tuesday’s ruling “marks a loss for every American who relies on their cell phone.”

“I’d be surprised in this case if consumers get anything out of it,” said Cardozo law professor Sam Weinstein, a former Justice Department antitrust attorney.

Gigi Sohn, a former Federal Communications Commission adviser who is now a fellow at Georgetown’s law school, said that while consumers are often promised benefits from mergers, “what they are left with each time are corporate behemoths” that can raise prices and destroy competition.

In the airline industry, there have been price increases and quality deterioration, like flight delays, on routes where carriers used to compete and then merged, said John Kwoka, an economics professor at Northeastern University.

He said that mergers that shrink an industry from four to three players “almost invariably result in price increases.” He said that while economists used to be concerned that the government was challenging too many mergers, the more prevalent worry these days is about too much industry concentration.

Eleanor Fox, an antitrust expert at New York University’s law school, said it was “quite strange” for the judge to accept the companies’ argument that prices won’t go up. Still, many U.S. economists do see mergers as positive for competition, she acknowledged, as they assume that markets operate better without government intervention.

T-Mobile launched its bid for Sprint in 2018, after having been rebuffed by Obama-era regulators. T-Mobile CEO John Legere had seen President Donald Trump’s election and his appointed regulators as a good opportunity to try again to combine, according to evidence during the trial.

The deal already got the nod from both the Justice Department and the FCC, thanks to an unusual commitment to create a new wireless player in the satellite TV company Dish. TMobile agreed to sell millions of Sprint’s prepaid customers to Dish. TMobile also has to rent its network to Dish while the fledgling rival built its own. Dish is also required to build a 5G network over the next several years.

Another judge still needs to approve the Dish settlement, a process that is usually straightforward but has taken longer than expected. A utility board in California also has to approve the merger.

Dish has spent about $21 billion over a decade buying wireless spectrum, the airwaves for transmitting data and calls, although Dish hasn’t done much with it. Analysts have long been skeptical of whether Dish intends to build its own network or sell the spectrum to others. Now Dish faces up to $2.2 billion in fines if it fails to create a 5G network that serves 70% of the country by 2023.

George Slover, senior policy counsel for Consumer Reports, said Sprint was an established carrier with a track record of spurring competition, while Dish is an unproven newcomer that will have to build its mobile phone network and services from scratch.

But Marrero, the judge, said Sprint was “at best struggling to even tread water” and would not last as a national wireless competitor. He said Dish’s entry into the market would be good for competition.

Sprint shares jumped 78%, T-Mobile rose 12% and Dish climbed 7% in trading Tuesday after the ruling came out. Verizon shares fell nearly 3% and AT&T was almost unchanged.

Attorneys general from New York and California led the case and were joined by Connecticut, Hawaii, Illinois, Maryland, Massachusetts, Michigan, Minnesota, Oregon, Pennsylvania, Virginia, Wisconsin and the District of Columbia.

T-Mobile, based in Bellevue, Washington, is owned by the German telecommunications company Deutsche Telekom. Sprint is based in Overland Park, Kansas, and is owned by Japan’s SoftBank.