SAN FRANCISCO — For Apple, the iPhone continues to be the device that makes the company tick.

While top rivals like Samsung are starting to show weakness in phone sales, Apple sold 35.2 million iPhones in the third fiscal quarter, up 13 percent from the period a year ago. The total was slightly below the estimates of analysts, who had expected 36 million iPhones to be sold.

But for Apple, slightly disappointing analysts on iPhone sales does not appear to be cause for alarm. The company, which is based in Cupertino, Calif., reported profit of $7.75 billion in the quarter that ended June 28, up from $6.9 billion in the quarter a year earlier.

Revenue was $37.43 billion, up from $35.32 billion in the quarter a year ago. Wall Street analysts had expected revenue of $37.93 billion, according to a survey of analysts by Thomson Reuters.

Healthy sales of Macs also helped fuel the growth, the company said. Apple reported selling 4.4 million Macs, up from 3.8 million in the same quarter last year, beating analysts’ expectations of about 3.9 million.