There's a controversial merger on the horizon that may spell doom for Sprint Nextel (NYSE: S). You've probably heard about it: AT&T (NYSE: T) is acquiring T-Mobile from German phone company Deutsche Telekom. In a nutshell, this deal would push AT&T ahead of present subscriber king Verizon (NYSE: VZ) and leave Sprint Nextel a distant third. Sprint would be even more vulnerable to extinction, and its demise would leave only two major wireless carriers.

But things could have been different -- and nearly were.

A merger that would have made sense for a more competitive marketplace -- and certainly for Sprint's survival -- was so close to happening. As recently as early March, Sprint Nextel and Deutsche Telekom discussed having Sprint buy T-Mobile in exchange for Deutsche's getting, perhaps, a 50% share in the new company.

Deutsche Telekom relied on T-Mobile for about a quarter of its sales, but the future didn't look good. T-Mobile is falling behind AT&T and Verizon in customer growth and lagged rivals in building out its 3G network. Not getting the iPhone didn't help, either. So Deutsche's talks with Sprint came at a fortunate time for both companies.

The stumbling block, it turns out, was price. Estimates then placed T-Mobile's value at between $15 billion and $20 billion. But just a few weeks later, AT&T blew any such deal with Sprint Nextel out of the water. It made an offer Deutsche Telekom couldn't refuse: $39 billion. Sprint, with its market cap of just $16 billion and its heavy debt load of $18 billion, simply didn't have the resources to compete with AT&T. In addition, because of disparate network standards, any acquisition by Sprint would have caused far more taxing integration costs on the company. Sprint learned how difficult this process can be during its difficult merger with Nextel.

As it now stands, the FCC and the Justice Department's antitrust unit are both considering the AT&T–T-Mobile merger. If it does pass inspection, Sprint will have to pull quite a rabbit out of its hat just to keep hanging around. But while the deal is still pending, as fellow Fool Anders Bylund points out, Sprint is not standing still. It is undertaking an intense lobbying campaign and trying to get as many states as it can to investigate how the merger would hurt consumers.

So the fight is not yet over, but for a while -- before AT&T made its eleventh-hour deal-breaking offer -- Sprint Nextel could have been a contender.

Keep an eye on this corporate menage-a-trois by placing these stocks in your Watchlist.