Federal regulators approved T-Mobile’s blockbuster merger with Sprint on Friday after 15 months of negotiations, paving the way for the third- and fourth-largest wireless carriers to form another titan in the industry.

The merger has been touch-and-go for months but last-minute concessions from the companies appear to have sealed the deal with the Justice Department.

DOJ is proposing a settlement that would require T-Mobile to transfer assets to satellite TV provider Dish Network to create a new wireless carrier in an attempt to assuage concerns that combining the third and fourth largest providers would hurt competition. Sprint will divest Boost Mobile, Virgin Mobile, and its prepaid phone business under the agreement.

Sprint and T-Mobile announced plans to merge in April 2018, creating a $146 billion wireless carrier under the T-Mobile brand. The companies claim that joining forces will increase competition in the wireless industry, allowing the combined carrier to take on behemoths AT&T and Verizon.

Dish will pay $1.4 billion for about 9 million Sprint customers, according to The Wall Street Journal. The satellite TV company will also be allowed to operate on T-Mobile’s network during a transition period of seven years. In three years, Dish will buy about $3.5 billion worth of spectrum licenses from Sprint that will help the provider deliver service to rural areas. While some view it as an opportunity for Dish, analysts as MoffettNathanson downgraded the company’s stock following the reports because entering the wireless space is tough, especially if you’re in last place.

“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,” said Makan Delrahim, DOJ’s antitrust lead in a statement.

Dish has committed to deploy a 5G network that is capable of serving 70 percent of the U.S. population by 2023, according to a press release from the company.

Though the DOJ gave T-Mobile the greenlight, the merger still faces a legal challenge from more than a dozen states. The plaintiffs claim the merger will harm consumers and raise prices by at least $4.5 billion a year. The merger cannot be completed until that dispute is resolved. The companies also need sign-off from the FCC, which looks likely, and California Public Utilities Commission.

The approval comes shortly after T-Mobile reported a record financial quarter. The company reported an 11 percent year-over-year increase in customers, bringing the total to more than 83 million. Fewer than 1 percent of customers discontinued their phone plans in Q2 as T-Mobile generated revenue of $11 billion.

“Not only is this an all-time record low, we’re also beating AT&T for the third quarter in a row,” said T-Mobile CEO John Legere during the company’s earnings call Friday.

One of T-Mobile’s big selling points was 5G, the next generation of wireless technology. The company says joining forces with Sprint will accelerate U.S. 5G deployment, a key priority for President Donald Trump. His administration is particularly concerned with 5G and broadband access for rural America, though experts are skeptical that the private sector will fill those gaps.

Legere celebrated the approval Friday in statements and on Twitter.

Our goal was to address the concerns of the @JusticeATR AND ensure we continue to deliver on key benefits of the $43B in synergies that are unlocked with New T-Mobile… and that's what we did! https://t.co/jEoO85NeeT Key info: https://t.co/Ioa23FUBQe — John Legere (@JohnLegere) July 26, 2019

Sprint CEO Marcelo Claure added, “Today’s clearance from the DOJ, along with our anticipated approval from the FCC, will allow the U.S. to fiercely compete for 5G leadership.”

But the deal still has its skeptics. Common Cause, a D.C.-based watchdog group, is petitioning the FCC to deny the merger.

“Basic math tells you that replacing Sprint, a national carrier with 50 million subscribers, with Dish, a satellite company with zero wireless subscribers, is a recipe for competitive disaster,” said Common Cause Advisor Michael Copps, a former FCC Commissioner, in a statement.

It’s a bit dumbfounding to think that we’ve decided to go and build this network and go through this merger so that we can become the basic lazy, fat, dumb, and arrogant players that we were born to teach how to behave.

Legere addressed that concern head-on during the earnings call.

“It’s a bit dumbfounding to think that we’ve decided to go and build this network and go through this merger so that we can become the basic lazy, fat, dumb, and arrogant players that we were born to teach how to behave,” he said. “We want to continue their education in a major way.”

News of the approved merger comes just as the Justice Department announced it is reviewing “market-leading online platforms” for antitrust violations. The agency did not name names, but indicated it is looking at search, social media, and online retail. That suggests the four companies hauled before the House Judiciary Committee for an antitrust hearing earlier this month: Apple, Amazon, Facebook, and Google. Facebook confirmed it is under investigation by the FTC in its second-quarter earnings report this week.

When T-Mobile and Sprint announced their intention to merge in 2018, Legere said the companies would spend $40 billion on the integration. More than 200,000 people will work for the combined company initially, which will retain T-Mobile’s name and CEO.

“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,” Legere said Friday. “It may have taken longer than expected by some, but today’s results are a win-win for everyone involved.”