T-Mobile US is close to agreeing to tentative terms on a deal to merge with peer Sprint, people familiar with the matter said, a major breakthrough in efforts to merge the third and fourth largest U.S. wireless carriers.

Japan's SoftBank, which controls Sprint, will own 40 to 50 percent of the combined company, two of the sources said on Friday, while T-Mobile owner Deutsche Telekom will own a majority stake.

The sources asked not to be identified because negotiations are confidential.

CNBC reported earlier this week that both companies and their parents have been in frequent conversations about a stock-for-stock merger in which T-Mobile parent Deutsche Telekom would emerge as the majority owner.

Once terms are finalized, due diligence by the two companies will follow and a deal is expected by the end of October, though talks may still fall through, the sources said.

The deal would also face regulatory scrutiny over concerns that the U.S. wireless market is becoming too concentrated.

A successful deal would create a business with more than 130 million subscribers, just behind Verizon Communications and AT&T. Revenues would top $70 billion and, analysts said, there would be massive scope to cut costs.

Sprint shares jumped 5 percent in premarket trading in New York, while T-Mobile rose 1 percent.

Sprint declined to comment. T-Mobile, SoftBank and Deutsche Telekom did not immediately respond to requests for comment.

T-Mobile has a market capitalization of $52 billion, while Sprint has a market capitalization of $32 billion.

SoftBank founder Masayoshi Son abandoned an earlier attempt to acquire T-Mobile for Sprint in 2014 amid opposition from antitrust regulators concerned that consumers could lose out.

T-Mobile has outperformed Sprint under Chief Executive John Legere, who the sources said would lead the combined company.

—CNBC contributed to this report.