Sprint and T-Mobile are in advanced discussions about merging, and a deal could be announced as soon as this weekend, people briefed on the matter said Friday.

Such a deal would complete one of the telecommunications industry’s most anticipated transactions and would create the third-largest wireless carrier in the United States, with more than 127 million customers. Sprint and T-Mobile have tried to negotiate a merger twice before, though plans collapsed for different reasons: the first time in 2014 because of opposition from regulators in the Obama administration, the second last year because of disputes over control of the combined company.

Analysts have argued — and Sprint and T-Mobile have acknowledged — that the companies must grow, and gain more resources at their disposal, to better compete against the industry’s leaders, Verizon and AT&T. The two companies are still negotiating the final details, the people briefed on the talks said. They also warned that the talks could be delayed or even fall apart.

Should the deal be completed, just three companies would dominate the U.S. market for cellphone service. Before that, Sprint and T-Mobile will first need regulatory approval.

Tom Wheeler, the chairman of the Federal Communications Commission in 2014, publicly announced then that he would not allow the number of national wireless carriers to shrink to three from four. The Justice Department made similar comments, saying consumers would be harmed without four options for mobile providers.

The regulatory picture has grown hazier since the Trump administration took office, which may provide an opportunity for the companies.

The current FCC chairman, Ajit Pai, criticized the previous administration’s strict approach to competition in the wireless industry.

“I don’t think any regulator who embraces regulatory humility and intellectual honesty about economics can say whether three or four or five is the optimal number,” Pai said in a 2017 interview with Recode, referring to the number of carriers operating with any scale in the United States.

The Justice Department, whose antitrust division is led by Makan Delrahim, has been hard to predict, analysts say. Delrahim is suing to block AT&T’s purchase of Time Warner, saying that the deal would hurt competition and lead to higher prices for consumers.

A representative from Sprint declined to comment, as did FCC and Justice Department officials. T-Mobile did not immediately respond to a request for comment.

“In 2014, when T-Mobile and Sprint tried, the government said forget about it. The government hasn’t said that yet,” said Blair Levin, a policy adviser for New Street research.