AT&T (T) reported a 5% increase in first-quarter profit and trumped Wall Street expectations, as sales of 4G mobile data started to ramp up and a decline in iPhone sales helped improve wireless margins.

The second-largest mobile phone operator by revenue in the U.S. behind Verizon Wireless reported a profit of $3.6 billion, or 60 cents a share, compared with a year-earlier $3.4 billion, or 57 cents. Analysts in a Thomson Reuters poll were projecting 57 cents a share last quarter.

Revenue for the three months ended March 31 was $31.8 billion, up 1.8% from $31.25 billion a year ago, matching the Street’s view. The improvements reflect record sales of smartphones and branded computing devices that helped mobile data revenue climb 20%, or more than $1 billion, to $6.1 billion.

“We continue to capitalize on our terrific momentum in mobile Internet,” AT&T chief executive, Randall Stephenson, said in a statement. “These results add confidence in our outlook for the year.”

Despite selling a record 5.5 million smartphones, which usually clamps down on margins given the large subsidies offered on those phones, wireless operating income margin was 27.2% compared with 25.8% a year ago.

While the company said demand for both Apple’s (AAPL) iPhone and Google’s (GOOG) Android devices remained strong during the period, it actually sold fewer iPhones than in the previous quarter, activating just 4.3 million compared with 7.4 million in the fourth quarter.

AT&T said it added 726,000 wireless subscribers during the period, bringing total service customers to 103.9 million. The mobile handset giant added 187,000 postpaid customers.

Wireline operating income increased 2.4% to $1.8 billion and its margins improved to 12.2% from 11.8% in the first quarter of 2011.

AT&T said improved consumer and business strategic service revenue trends helped to offset declines in voice sales.  

Follow Jennifer Booton on Twitter at @Jbooton