The biggest corporate deal of the year is dead.

AT&T ran into a buzzsaw of government opposition to its proposed $39 billion takeover of mobile company T-Mobile USA. And now the companies are throwing in the towel.

AT&T said in a statement that it and T-Mobile parent company Deutsche Telekom have agreed to drop the merger, which was first announced in March.

The statement says, in part:

"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. 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. In the absence of such steps, customers will be harmed and needed investment will be stifled."

AT&T said it will record a $4 billion pretax accounting charge in the fourth quarter, to reflect the value of the breakup fee it owes to Deutsche Telekom. AT&T already had set aside the money. AT&T also said it will enter into a "mutually beneficial" mobile roaming agreement with Deutsche Telekom.