Faced with the prospect of a long war with U.S regulators it seemed destined to lose, AT&T announced on Monday it would give up on its $39-billion attempt to purchase T-Mobile, even though the decision will cost the nation's number-two carrier at least $4 billion to walk away from the deal.

The proposed merger would have brought together the second- and fourth-largest telecommunications carriers in the United States, ultimately surpassing Verizon Wireless to be the largest telecom in the country. As recently as 11 days ago AT&T said it would not back down (though Chief Financial Officer John Stephens did seem to betray a bit of uncertainty). Instead, AT&T is out $4 billion with nothing to show for a proposed merger that drew instant fire from consumer groups and spectrum geeks.

Further, AT&T will be forced to transfer radio spectrum to T-Mobile, as well as "enter a mutually beneficial roaming agreement with Deutsche Telekom," according to AT&T's statement. The entire package will cost AT&T $3 billion in cash, plus at least another billion or more in spectrum and network sharing agreements.

Not that AT&T is conceding the merger was a bad idea.

“The actions by the Federal Communications Commission and the Department of Justice to block this transaction do not change the realities of the U.S. wireless industry," the company said in a statement. "It is one of the most fiercely competitive industries in the world, with a mounting need for more spectrum that has not diminished and must be addressed immediately. The AT&T and T-Mobile USA combination would have offered an interim solution to this spectrum shortage."

AT&T claims the failure of the deal to go through will ultimately impact customers negatively: "Customers will be harmed and needed investment will be stifled," the company said.

The decision to end the merger comes after a key loss at the FCC last month, in which chairman Julius Genachowski circulated a draft order to seek a further administrative hearing on the deal. Though the move from Genachowski read as procedural, it was yet another stumbling block in a long line of obstacles on the company's road to acquiring T-Mobile.

Similarly, in August AT&T faced a stare-down from the Department of Justice, who filed a federal antitrust lawsuit against AT&T, stating that the merger would be bad for consumers as well as unnecessary for AT&T to further expand its wireless network.

“The combination of AT&T and T-Mobile would result in tens of millions of consumers all across the United States facing higher prices, fewer choices and lower-quality products for mobile wireless services,” said deputy attorney general James M. Cole in an August statement.

As the third largest carrier in the United States behind Verizon and AT&T, Sprint has long been the most vocal opponent of the deal, filing its own lawsuit against the AT&T-T-Mobile merger in September. The suit claimed that such a proposed merger would create a duopoly, with AT&T and Verizon controlling over 75 percent of the wireless market. Already marginalized to a degree as the current third-place title holder, Sprint would sink further down the competition leaderboard if the merger were to have gone through.

"This is the right decision for consumers, competition and innovation in the wireless industry," SVP Government Affairs for Sprint Vonya B. McCann said in a statement. "

Shares of Sprint shot up eight percent in after hours trading on the news, while AT&T stock dropped by less than one percent.

UPDATE 4:30 P.M. PST with Sprint statement

Photo: AT&T customer appreciation token. Credit: MrVJtod