Sprint Corp. is nearing an agreement on the price, capital structure and termination fee for an acquisition for T-Mobile US Inc. that could value the wireless carrier at almost $40 a share, sources said.

Sprint, 80 percent owned by SoftBank, will offer about 50 percent stock and 50 percent cash for T-Mobile, leaving parent Deutsche Telekom AG with about a 15 percent stake in the combined company, the sources said.

The agreement could be announced as soon as July, they said.

A deal would bring together the third- and fourth-largest U.S. wireless carriers.