AT&T Inc., the largest U.S. phone company, posted a narrower fourth-quarter loss after customers bought a record number of discounted smartphones, including 8.6 million of Apple Inc.’s iPhones.

The loss shrank to $3.86 billion, or 68 cents a share, from $6.68 billion, or $1.12, a year earlier, Dallas-based AT&T said Thursday. Leaving out charges such as pension costs, profit was 44 cents a share, missing the 45-cent average of analysts, according to data compiled by Bloomberg. Sales were little changed at $32.6 billion, topping the estimate of $32.2 billion.