(Reuters) - T-Mobile US Inc TMUS.O and Sprint Corp S.N said on Sunday they had agreed to a $26 billion all-stock deal and believed they could win over skeptical regulators because the merger would create thousands of jobs and help the United States beat China to creating the next generation mobile network.

The agreement capped four years of on-and-off talks between the third and fourth largest U.S. wireless carriers, setting the stage for the creation of a company with 127 million customers that will be a more formidable competitor to the top two wireless players, Verizon Communications Inc VZ.N and AT&T Inc T.N.

U.S. regulators, who have challenged in court AT&T's $85 billion deal to buy U.S. media company Time Warner Inc TWX.N, are expected to grill Sprint and T-Mobile on how they will price their combined wireless offerings.

Verizon has 116 million U.S. wireless customers, according to a spokesman, while AT&T has 93 million branded customers, as of the first quarter.

Their first round of merger talks ended unsuccessfully in 2014 after the administration of then-U.S. President Barack Obama expressed antitrust concerns.

The new deal will create the highest-capacity U.S. network, lower prices, create jobs and improve service in rural areas, said John Legere, the chief executive of T-Mobile and the new head of the proposed combined company.

The combined company, which will be called T-Mobile, will invest $40 billion over the next three years to upgrade its networks to accommodate the next generation 5G wireless technology, which is expected to have the speeds necessary to power drones and self-driving cars, Legere said in a statement.

The companies said during a conference call with analysts that the recent U.S. tax overhaul would have a positive impact, and the combined company would not be a significant taxpayer until 2025.

T-Mobile and Sprint said they expected to complete their deal no later than the first half of 2019, an ambitious goal given the intense U.S. regulatory scrutiny it will be subjected to. T-Mobile will not be liable to pay Sprint a breakup fee should regulators block the deal, according to sources who asked not to be identified because that detail in their contract had not yet been made public.

The companies said they expected U.S. regulators would see the benefits of the deal.

“This isn’t a case of going from four to three wireless companies – there are now at least seven or eight big competitors in this converging market,” Legere said, referring to cable companies as wireless competitors. Other companies also would be forced to accelerate their investments in the face of a combined T-Mobile-Sprint, the companies added.

A spokeswoman for Federal Communications Commission Chairman Ajit Pai declined to comment on Sunday on the proposed merger. The FCC will decide whether to grant the deal regulatory approval if it is in the “public interest,” the spokeswoman added.

CTIA, a trade organization that represents the U.S. wireless communications industry, ranks the United States behind China and South Korea in 5G readiness. The Chinese government launched a plan targeting 5G deployment by 2020, with three carriers committed to the timeline.

Legere said the deal would likely lead to lower prices from AT&T and Verizon, as well as Comcast Corp CMCSA.O.

AT&T declined to comment. Comcast could not immediately be reached for comment.

Verizon declined to comment on prices but said it remained committed to building a 5G network.

Slideshow ( 7 images )

DEAL BREAKTHROUGH

The breakthrough in the companies' negotiations, first reported by Reuters on Thursday, came after T-Mobile majority-owner Deutsche Telekom AG DTEGn.DE and Japan's SoftBank Group Corp 9984.T, which controls Sprint, agreed on a structure that would allow Deutsche Telekom to continue to consolidate the combined company, which will have a market value of over $80 billion, on its books.

Deutsche Telekom will own 42 percent of the combined company, and will control the board of the combined company, nominating nine of the 14 directors. Legere will also serve as a director.

The implied equity valuation for Sprint is $6.62 per share based on T-Mobile’s closing share price on Friday. Sprint shares closed on Friday at $6.50.

The all-stock transaction is at a fixed exchange ratio of 0.10256 T-Mobile shares for each Sprint share, or the equivalent of 9.75 Sprint shares for each T-Mobile US share.

Slideshow ( 7 images )

Tokyo-based SoftBank and Deutsche Telekom will sign a voting rights agreement that will give Deutsche Telekom access to voting rights for a total of 69 percent of T-Mobile shares.

The second round of talks between Sprint and T-Mobile ended in November over valuation disagreements.

Since then, Sprint’s shares lost about a fifth of their value amid questions about how the company can compete effectively under the weight of its long-term debt of more than $32 billion.

T-Mobile’s market capitalization is $54.7 billion, while Sprint is valued by the deal at $26 billion.

INVESTING IN 5G TECHNOLOGY

Even though Sprint’s customer base has expanded under CEO Marcelo Claure, growth has been driven by discounting. Analysts say that without T-Mobile, Sprint lacks the scale needed to invest in its network and to compete in a saturated market.

T-Mobile has fared better than Sprint, even if it remains a distant third to Verizon and AT&T. It has managed to score sustained market-share gains, as innovative offerings, improving network performance and good customer service attract new customers, according to Moody’s Investors Service Inc.

T-Mobile became the first major U.S. carrier to eliminate two-year contracts, a shift quickly embraced by consumers and copied by competitors. The company has also badgered rivals with its unlimited data plans.

Both Sprint and T-Mobile are far behind Verizon and AT&T in upgrading their network to accommodate next generation 5G wireless technology. Even after their merger, the combined company’s budget to invest in 5G will be smaller than that of Verizon or AT&T.

Sprint and T-Mobile hope the deal will give them more firepower to participate in auction for spectrum to develop 5G. They plan to participate in a spectrum auction in late autumn and will request a waiver if the merger prevents the companies from participating.

PJT Partners, Goldman Sachs, Deutsche Bank and Evercore served as advisers for T-Mobile. The Raine Group, J.P. Morgan and Centerview Partners LLC advised Sprint.