Apple Inc. said its quarterly profit rose 31%, sparked by strong demand for iPhones in China.

Booming iPhone sales have propelled the company to a string of strong results while withstanding a slowdown in the global smartphone market. Apple followed up its first large-screen iPhones with a pair of new releases in late September, but the company faces questions about whether it can maintain its sales momentum of the past year.

The company said it sold 48.04 million iPhones in its fiscal fourth quarter ended Sept. 26, surpassing sales of 39.27 million units a year earlier. However, it fell short of analysts' estimates of 48.72 million units in the quarter. The September quarter included only two business days where Apple offered its most recent models, iPhone 6S and 6S Plus.

Apple said fourth-quarter net income totaled $11.12 billion, up from $8.47 billion in the year-ago period. Earnings per share rose more sharply, to $1.96 from $1.42, because of Apple's aggressive share-repurchase program.

Revenue rose 22% to $51.50 billion from $42.12 billion in the same period a year earlier.

Analysts polled by Thomson Reuters estimated that Apple would post earnings of $1.88 a share on revenue of $51.1 billion.

Apple also reported gross margin, the percentage of revenue that remains after manufacturing costs, of 39.9%, above its estimated range of 38.5% to 39.5%. Gross margin is a closely watched measure of profitability.

For the current quarter ending December, Apple said it expects a gross margin of between 39% and 40%. It sees revenue of $75.5 billion to $77.5 billion. Analysts had been projecting revenue of $77.14 billion with a gross margin of 39.8%.

More than any other product, the iPhone is the linchpin to Apple's earnings. It accounted for nearly 63% of revenue in the quarter, and a greater portion of Apple's profits.

Any slowdown to iPhone demand is a major concern for investors. Apple released the new iPhones accompanied by a marketing campaign--"The only thing that's changed is everything"--aimed at critics who said the phones don't deliver as many noticeable changes as predecessors.

Apple Chief Executive Tim Cook said he expects iPhone sales to grow again in the current quarter. Some analysts have questioned whether Apple's iPhone sales may dip in the current quarter compared with last year, when Apple sold a record 74.46 million iPhones.

"We're pretty confident that we can grow this quarter despite having the mother of all comps," said Mr. Cook in an interview with The Wall Street Journal.

Mr. Cook said there are still many iPhone consumers who haven't upgraded to the larger-screen iPhone. He says about two-thirds of iPhone's customer base before the first batch of larger iPhones were introduced in 2014 haven't upgraded to newer models.

At the same time, Apple said it is winning over customers from rivals. Mr. Cook said 30% of consumers who bought an iPhone replaced a smartphone running Google Inc.'s Android operating system during the quarter. He said this is the highest rate of Android "switchers" that Apple has ever measured.

The iPhone continues to do well in China, where it has become a premium brand akin to Prada bags or Rolex watches. As more Chinese consumers enter the middle class with greater disposable income, they are embracing the iPhone.

What's more, the iPhone's hefty price tag--once considered a liability--now works in Apple's favor, allowing it to stand out from a fast-growing pack of low-cost smartphones and reinforcing the view that its products are of a higher quality.

Sales to Greater China, which includes Hong Kong and Taiwan, rose 99% to $12.5 billion. But sales declined slightly from the prior quarter, during a period in which the rest of the Chinese smartphone market slowed more noticeably.

Apple didn't disclose sales for Apple Watch, its first all-new hardware product since 2010. Watch sales were included with the iPod, Apple TV and Beats accessories in the "other products" category. Sales of that segment rose 61% to $3.04 billion.

Sales of Apple's previous breakthrough hardware product, the iPad, continued to slump. Apple's tablet sales fell for a seventh straight quarter, down 20% in unit terms. The iPad and tablet computers, in general, are facing an existential problem--not as essential as the smartphone but not as functional as a notebook computer.

Apple aims to solve a few issues hampering iPad demand with a new larger-size iPad coming out next month. Many early iPad buyers don't see a compelling reason to upgrade to recent models, but Apple sees a new wave of demand from consumers seeking a larger-screen tablet computer for the workplace.

Write to Daisuke Wakabayashi at Daisuke.Wakabayashi@wsj.com

Access Investor Kit for "Apple, Inc."

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US0378331005

Subscribe to WSJ: http://online.wsj.com?mod=djnwires