Charlie Ergen is poised to get into the wireless phone biz as part of T-Mobile and Sprint’s merger getting the regulatory green light from the Justice Department.

Ergen’s Dish Network entered into a $5 billion deal to acquire Sprint’s prepaid wireless businesses and a 14-MHz slice of spectrum in the 800-MHz band. That transaction was a requirement of the DOJ’s approval of T-Mobile and Sprint’s proposed $26.5 billion merger, announced Friday. The T-Mobile/Sprint tie-up combines the third and fourth biggest U.S. wireless carriers, and the new entity will serve around 80 million customers.

The announcement clears a huge regulatory hurdle in the companies’ 15-month saga to win approval for the deal. T-Mobile and Sprint first announced their plans to merge in April 2018, and execs have argued that by joining forces they would be much better equipped to compete with industry leaders AT&T and Verizon. But the DOJ and the Federal Communications Commission were concerned the deal would reduce competition and sought to establish a “fourth” carrier — a role that now falls to Dish, whose core offering to date has been satellite TV.

“Today’s settlement will provide Dish with the assets and transitional services required to become a facilities-based mobile network operator that can provide a full range of mobile wireless services nationwide,” Assistant Attorney General Makan Delrahim of the DOJ’s Antitrust Division, said in a statement.

The companies involved are acting as if the deal is ready to roll forward — however, the T-Mobile/Sprint merger and the sale of wireless assets to Dish still face opposition from several state attorneys general. AGs from 13 states and the District of Columbia sued to block the deal in June. On Friday, the DOJ said it had the support of of five of the state AGs (from Nebraska, Kansas, Ohio, Oklahoma, and South Dakota).

New York Attorney General Letitia James, for one, signaled that the legal challenges to the deal are not finalized. “The promises made by Dish and T-Mobile in this deal are the kinds of promises only robust competition can guarantee,” James said in a statement. “We have serious concerns that cobbling together this new fourth mobile player, with the government picking winners and losers, will not address the merger’s harm to consumers, workers and innovation.”

T-Mobile and Sprint said they expect to receive final regulatory approval in the third quarter of 2019 and currently anticipate that the merger will close in the second half of the year.

Under the terms of the deal, as approved by the DOJ, Dish will obtain Sprint’s Boost Mobile, Virgin Mobile and other prepaid businesses — representing 9.3 million customers total — and enter into a “mobile virtual network operator” deal with the New T-Mobile for seven years. Additionally, T-Mobile and Sprint must make available to Dish at least 20,000 cell sites and hundreds of retail locations. Dish will pay about $1.4 billion for the prepaid mobile business and roughly $3.6 billion for spectrum (the latter expected to be completed in three years), according to the companies. Dish is barred from selling or transferring the assets or MVNO agreement for three years.

“Our goal was to ensure that the DOJ’s concerns were addressed while enabling us to deliver on every aspect of the synergies we promised to unlock… and we did it,” T-Mobile CEO John Legere said in a statement. “It may have taken longer than expected by some, but today’s results are a win-win for everyone involved.”

The DOJ’s thumbs-up on the deal comes after the department this week announced a broad antitrust investigation into big tech companies, which are widely presumed to include Facebook, Google and Amazon.

For Dish, the entree into wireless phones comes after it spent some $21 billion to acquire wireless spectrum licenses over two decades. Previously, Dish has announced plans to deploy a 5G-capable network, focused on supporting narrowband internet-of-things applications, with the first phase scheduled to be completed by March 2020. On Friday, Dish announced that it had made new commitments to the FCC to use its spectrum holdings to deploy a nationwide 5G broadband network covering at least 70% of the U.S. population by June 14, 2023. If it fails to hit the deadlines, Dish will pay the U.S. government up to $2.2 billion.

Analysts are bearish on Dish’s deal with T-Mobile/Sprint, which had previously been reported by the Wall Street Journal and Bloomberg. The problem: With Dish getting into the wireless business, its spectrum holdings will be valued as an operating asset — not, as some had anticipated, assets the company would sell to the highest bidder.

“The biggest loser here is Dish Network, or rather, Dish Network’s investors,” MoffettNathanson analyst Craig Moffett wrote in a note Thursday. He downgraded Dish to a “sell” rating and set a $30 price target on the stock. Moffett noted that it will be extremely costly for Dish to build out a competitive 5G network, saying that “the idea that Dish might spend $10B (their own estimate on previous conference calls) and then somehow be finished is, well, just silly.”

Ergen, Dish’s chairman, positioned the company’s foray into becoming a facilities-based wireless provider as akin to its launch into the pay-TV business in 1995, taking on cable TV. “As we enter the wireless business, we will again serve customers by disrupting incumbents and their legacy networks, this time with the nation’s first standalone 5G broadband network,” he said in a statement.

T-Mobile and Sprint execs have claimed the “New T-Mobile” will invest nearly $40 billion to combine their respective spectrum, sites and assets to launch a nationwide 5G network and services sooner than otherwise possible. Deutsche Telekom will be the single largest shareholder in and will control the new company (with a 42% stake) alongside Sprint majority owner SoftBank Group (which holds 27%). Legere would become the CEO of the new entity.

In May, FCC Chairman Ajit Pai said he supported the merger after the companies agreed to stepped-up guarantees. Those included enhanced 5G buildout commitments — covering 97% of the U.S. population within three years of the closing of the merger and 99% within six years — and an agreement to spin off Sprint’s Boost Mobile. T-Mobile and Sprint also have promised that 90% of Americans would have access to mobile broadband service at speeds of at least 100 megabits per second and 99% would have access to speeds of at least 50 Mbps.

In addition, T-Mobile and Sprint pledged that the combined company would roll out in-home 5G broadband within three years to at least 9.6 million eligible households, of which at least 2.6 million will be in rural areas.

“I am pleased that the U.S. Department of Justice has reached a settlement with T-Mobile and Sprint,” Pai said in a statement Friday. “The commitments made to the FCC by T-Mobile and Sprint to deploy a 5G network that would cover 99% of the American people, along with the measures outlined in the [DOJ’s] consent decree, will advance U.S. leadership in 5G and protect competition.”

T-Mobile and Sprint had already committed to not to raise prices for three years following their merger. The companies would face billions of dollars in fines if they fail to follow through on their commitments, according to the FCC’s Pai.

Pictured above: T-Mobile CEO John Legere (l.) and Sprint executive chairman Marcelo Claure at a House Judiciary subcommittee hearing about their companies’ proposed merger in March 2019.