Sprint is nearing an agreement to acquire rival T-Mobile for almost $40 a share, Bloomberg reported Wednesday, a 17 percent premium over T-Mobile's closing stock price Wednesday.

If approved, the reported sales figure would represent a narrowing of the gap between the two sides' negotiation positions. Softbank, which owns about 80 percent of Sprint, was willing to pay in the upper $30s per share for T-Mobile, Deutsche Telekom, which owns about 67 percent of T-Mobile, was seeking at least $40 a share, Bloomberg reported.

Sprint has yet to make an official merger offer to T-Mobile, but speculation abounds that the company will float such an idea within the next couple of months. Sprint and T-Mobile have both argued that a merger would create a larger No. 3 carrier that could more effectively compete against AT&T and Verizon Wireless.

Sprint has been rumored for months to be laying the groundwork for a bid to buy T-Mobile. Two top Sprint executives reportedly met with the banks in April to secure financing structures and to discuss how much Sprint would need to borrow if it ultimately decides to bid on T-Mobile.

Shares of T-Mobile closed up 8 cents at $34.28, or 0.023 percent, giving it a market capitalization of $27.5 billion. Its share price was up 59 cents (1.72 percent) in after-hours trading.A $40 per share offer would value the company at $31.5 billion. Taking in to account T-Mobile's $15 billion in debt and $5 billion in cash, the value of the deal comes to about $50 billion.

Sprint closed down 10 cents in regular trading to $9.40, or 1.05 percent. Shares were up 38 cents in after-hours trading.

A merger between Sprint and T-Mobile would allow the two companies to share their considerable spectrum position, as well as reduce prices by eliminating redundant information systems and other costs. The two companies also would be able to raise the necessary capital expenditures to invest in a network better able to compete against AT&T and Verizon.

Regulators, however, have expressed their reluctance to approve such a deal, preferring to keep four nationwide competitors in the market. They point to T-Mobile, the fourth-largest wireless carrier by subscribers, which has surged back in recent months with renewed customer growth, as an example of why a merger with Sprint shouldn't happen.

CNET has contacted Sprint and T-Mobile for comment and will update this report when we learn more.