AT&T (T) swung to a massive quarterly loss on Thursday related to a break-up fee for its failed $39 billion T-Mobile acquisition and pricey subsidies for smartphones to attract customers as demand kicked up.

The company touted the fourth quarter as its “best ever” for smartphone sales, up nearly 60% year-over-year and 50% more than the previous record.  

“This was a blowout quarter for smartphone sales,” AT&T chief executive Randall Stephenson said in a statement.

However, sharp demand for smartphones often brings pricey subsidies, as carriers offer cheaper rates to try and entice customers to sign on to two-year contracts.

The No. 2 mobile carrier in the U.S. said it lost $6.7 billion, or $1.12 a share, compared with a year-earlier profit of $1.1 billion, or 18 cents. Excluding one-time items, AT&T earned 42 cents, missing average analyst estimates in a Thomson Reuters poll by a penny.

Revenue for the three months ended Dec. 31 was $32.5 billion, up 3.6% from the year-earlier period, beating the Street’s view of $31.97 billion.

Wireless revenue grew 10% while sales of wireless data climbed 19.4% as more customers purchased smartphones like Apple’s (AAPL) iPhone 4S.

The Dallas-based company booked 717,000 wireless postpaid net additions, the largest increase in five quarters, however the subsidies kept the segment’s margins weaker.

Looking ahead, AT&T said it is “well positioned” to deliver revenue and earnings growth in 2012 with improving margins. The company said it has plans in place to expand wireless margins.

Shares of AT&T were down nearly 2% Thursday.

AT&T was forced to scrap its plans to buyout Deutsche Telekom's T-Mobile USA in December after intense regulatory scrutiny. 

Follow Jennifer Booton on Twitter at @Jbooton