SAN FRANCISCO (Reuters) - Apple Inc AAPL.O on Thursday reported better-than-expected earnings and offered a rosy forecast for the holiday shopping season, allaying investor concerns about production delays on the new iPhone X and demonstrating remarkable strength across its growing line of products and services.

The stellar earnings report came just as the iPhone X went on sale Friday morning in Australia. Long lines were forming at Apple stores around the world, recalling the consumer frenzy that greeted early versions of the iPhone, but had faded with more recent launches.

With supplies potentially tight, some Australian purchasers were already planning to sell their phones for as much as A$3,000, nearly double the A$1,579 selling price.

Apple shares rose 4 percent in after-hours trading to hit an all-time high, with analysts lavishing praise on Apple CEO Tim Cook and speculating on when Apple might become the first public company worth a trillion dollars.

The earnings demonstrate how Apple is able to drive growth across an ever-expanding product line that now includes five different iPhone models along with the iPad, the Mac, the Apple Watch and a suite of fast-growing services offerings.

“We had good success, I would say, through the different iPhones,” Cook said on a call with analysts. “We tried hard to have an iPhone that is as affordable as possible for people that really want an iPhone, but may have a more limited budget.”

Just a few weeks ago, Apple appeared to be facing a rare stumble with a delay in the iPhone X launch and rumors of production problems that could limit supply.

But Apple executives on Thursday shrugged off the concerns as Chief Financial Officer Luca Maestri told Reuters the company was “quite happy” with how manufacturing of the iPhone X was progressing.

Analysts have been eager to see whether Apple can meet demand for the iPhone X during the crucial holiday quarter, with most saying it will likely take it until next year or early spring to do so.

Slideshow ( 13 images )

“Where the demand curve and supply curve are going to intersect, we do not know. It does not have a predecessor product,” Maestri told Reuters.

STRONG MARGINS

Apple forecast fiscal first-quarter revenue of $84 billion to $87 billion, at the high end of analysts average expectations of $84.18 billion, according to Thomson Reuters I/B/E/S.

“A trillion-dollar market cap may now be in Cook’s sights in light of these results and guidance around iPhone X,” said Daniel Ives, an analyst at GBH Insights, referring to Apple’s chief executive.

The Cupertino, California-based company’s market capitalization of about $868 billion already makes it the world’s most valuable publicly-traded company.

There are still questions around supplies of the new phone and longer-term demand.

Bob O’Donnell, head of Techanalysis Research, cautioned that if Apple is not able to fill demand for iPhone X over the holiday quarter, it would push buyers to wait until Apple’s March quarter, by which time they may have spent their money elsewhere.

“What we don’t know is, how long will this first group of (iPhone X buyers) last?” O’Donnell said.

Slideshow ( 13 images )

Apple said it sold 46.7 million iPhones in the fourth quarter ended Sept. 30, above analysts’ estimates of 46.4 million, according to financial data and analytics firm FactSet. However, average selling prices of $618 fell short of forecasts of $638.

The company’s net income rose to $10.71 billion, or $2.07 per share, in the quarter, from $9.01 billion, or $1.67 per share, a year earlier. That beat the average analyst estimate of $1.87 per share.

Apple forecast a gross margin of 38 percent to 38.5 percent, higher than many analysts expected because new products often have higher costs.

Maestri attributed the margin strength to Apple’s growing services business, which brought in $8.5 billion in revenue compared to analyst estimates of $7.5 billion. That included a favorable $640 million adjustment, though Apple officials did not elaborate.

The $28.85 billion revenue from iPhone sales accounted for nearly 55 percent of total revenue, which rose 12.2 percent to $52.58 billion.

Analysts on average were expecting total revenue of $50.7 billion, according to Thomson Reuters I/B/E/S.

Apple also said it returned to revenue growth in China, bringing in $9.8 billion compared with $8 billion a year ago, driven by double-digit unit sale increases of the iPhone. Maestri also told Reuters the company had doubled its revenue in India during the fiscal fourth quarter, though he did not give any details.