WASHINGTON (AP) — A federal judge approved the $85 billion mega-merger of AT&T and Time Warner on Tuesday, a move that could usher in a wave of media consolidation while shaping how much consumers pay for streaming TV and movies.

U.S. District Judge Richard Leon green-lit the merger without adding major conditions to the deal. The Trump Justice Department had sued to block the $85 billion merger, arguing that it would hurt competition in cable and satellite TV and jack up costs to consumers for streaming TV and movies.

The judge rejected the government’s argument that a merger would hurt competition in pay TV and cost consumers hundreds of millions of dollars more to stream TV and movies.

Now, the phone and pay-TV giant will be allowed to absorb the owner of CNN, HBO, the Warner Bros. movie studio, “Game of Thrones,” coveted sports programming and other “must-see” shows. The Justice Department could decide to appeal the ruling, however.

“The impact from this decision will have wide reaching ramifications across the telecommunications, media, and tech industry for decades to come,” said GBH Insights analyst Dan Ives. “For AT&T and Time Warner, this is a major victory lap.”

The mega-merger was a high-stakes bet by AT&T Inc. on combining a company that produces news and entertainment with one that funnels it to consumers. The merged company, executives said, would be better able to compete in an era in which people spend more time watching video on phones and tablets and less time on traditional live TV on a big screen.

Leon said the government failed to prove that the merger would lead to higher prices and other ham to consumers.

“The government here has taken its best shot to oppose this merger,” Leon said, speaking to a packed courtroom in an unusual session weeks after the trial ended. But, he added, “the government’s evidence is too thin a reed for this court to rely on.”

Leon rejected the notion of temporarily suspending the merger for a possible appeal by the government. The “drop dead” deadline for completing the merger is June 21. If it’s not wrapped up by then, either company could walk away, and AT&T would have to pay a $500 million breakup fee.

The ruling is a stinging defeat for the Justice Department. The proposed merger was so big and consequential that it forced federal antitrust lawyers to reconsider legal doctrine that permitted mergers of companies that don’t directly compete. First floated in October 2016, the deal also brought fire from then-candidate Donald Trump, who promised to kill it “because it’s too much concentration of power in the hands of too few.”

READ MORE: Why the Justice Department is suing to block the AT&T-Time Warner merger

Dallas-based AT&T is a wireless, broadband and satellite behemoth that also became the country’s biggest pay-TV provider with its purchase of DirecTV. It claims about 25 million of the 90 million or so U.S. households that are pay-TV customers.

Leon’s ruling could shape the government’s future competition policy. The ruling could open the floodgates to deal making in the fast-changing entertainment and video-content worlds. Major cable, satellite and phone companies are bulking up with purchases of entertainment conglomerates to compete against rivals born on the internet, like Amazon and Google.

Waiting in the wings are potential big-billions deals involving 21st Century Fox and Disney, Verizon and CBS, T-Mobile and Sprint. Comcast and Verizon are also jockeying for position in the new landscape.

As president, Trump has called the merger “not good for the country” and said he believed it would push pay-TV prices higher. Looming in the background of the deal has been Trump’s long-running feud with Time Warner’s CNN, which he has often derided as “failing” and a purveyor of “fake news.”

The ruling could shape the government’s future competition policy.

The six-week trial featured a parade of expert witnesses as attorneys for the opposing sides took Leon on a journey through the twisty dynamics of the media and entertainment landscape. The companies’ CEOs, AT&T’s Randall Stephenson and Jeffrey Bewkes of Time Warner Inc., testified in support of the deal.

The government argued that AT&T would gain outsize market power, jacking up the prices it charges cable providers to carry networks in the Time Warner stable. Post-merger, AT&T rivals like Charter Communications and Cox, which currently pay Time Warner for its channels, would suddenly also become AT&T’s customers. The government’s star witness was Carl Shapiro, an economist at the University of California, who used an economic model to predict that consumer cable bills could rise by $500 million annually in aggregate by 2021.

The companies’ main economist, Dennis Carlton from the University of Chicago, refuted Shapiro’s model as overly complicated and rejected his conclusions. The government failed to prove that the merger would dampen competition and innovation and raise prices for pay TV, said Daniel Petrocelli, the companies’ lead attorney in defending the merger. In fact, he suggested, consumers could end up paying less after a merger — maybe even $500 million less annually.

AT&T has said it needs to buy Time Warner to compete with the likes of Amazon, Netflix and Google in the shape-shifting streaming-TV environment. The combination would push technology forward and give consumers more choices, AT&T has promised.

“We are pleased that, after conducting a full and fair trial on the merits, the Court has categorically rejected the government’s lawsuit to block our merger with Time Warner,” said David McAtee, AT&T General Counsel. He said AT&T plans to close the deal on or before June 20.