(Reuters) - U.S. wireless carrier T-Mobile US Inc is exploring taking over rival Sprint Corp in an all-stock deal, after SoftBank Group Corp offered to give up its majority ownership of Sprint, a person familiar with the matter said.

Smartphones with the logos of T-Mobile and Sprint are seen in front of a Soft Bank logo in this illustration taken September 19, 2017. REUTERS/Dado Ruvic/Illustrations

The latest negotiations come after Reuters reported earlier this year that Japan’s SoftBank was prepared to give up control of Sprint to clinch a merger with T-Mobile, and only retain a minority stake in the combined company.

Sprint and T-Mobile, which is controlled by Germany’s Deutsche Telekom AG, are still weeks away from an agreement, and have not settled on a share exchange ratio or even started performing due diligence on each other, the source added.

The companies have agreed, however, that John Legere, T-Mobile’s outspoken chief executive, would run the combined company should there be a deal, according to the source, who asked not to be identified discussing confidential negotiations.

Both Sprint and T-Mobile did not immediately respond to requests for comment.

Sprint’s shares rose 8.2 percent, while T-Mobile’s shares were up nearly 5.3 percent after CNBC first reported on the progress of the talks.

Despite potential antitrust risks, investors have long expected a deal between T-Mobile and Sprint, the third- and fourth-largest U.S. wireless service providers, hoping for cost cuts and other synergies.

T-Mobile has been gaining share from larger U.S. competitors AT&T Inc and Verizon Communications Inc in a saturated U.S. wireless market, through network improvements and lower prices.

Sprint, which had earlier approached cable company Charter Communications Inc about a potential merger, has now put plans for a bid for Charter on the back burner as it focuses on negotiations with T-Mobile, the source said.

French cable mogul Patrick Drahi’s Altice USA Inc, however, is continuing to work on a potential bid for Charter, another source said. Altice declined to comment while Charter did not respond to a request for comment.

Last month, Sprint’s chief executive said an announcement on merger talks should come in the “near future.”

SoftBank previously abandoned talks to acquire T-Mobile and merge it with Sprint three years ago, amid opposition from U.S. antitrust regulators. That deal would have put SoftBank in control of the merged company, with Deutsche Telekom becoming a minority shareholder.

Since then, T-Mobile has overtaken Sprint in market capitalization - the company is valued at about $51 billion, while Sprint has a market value of about $34 billion.