The new $999 iPhone helped supercharge Apple's sales in the holiday season, but trouble may be ahead.

Apple (AAPL) said Thursday it posted sales of $88.3 billion in the final three months of 2017, beating its own sales forecast and setting a new quarterly record for the company. It also turned a record $20 billion profit.

However, Apple said it expects sales for the upcoming quarter to be between $60 billion and $62 billion, well below Wall Street estimates. The forecast raises concerns about demand for the new line of iPhones.

The iPhone X, Apple's priciest smartphone to date, went on sale during the holiday quarter. This was also the first full quarter when the new iPhone 8 and 8 Plus were available to customers.

Apple does not break out sales by model. The company said it sold 77.3 million devices, which is actually a slight 1% decline from the same period a year earlier. But the higher price tag for its models likely offset the dip.

The average selling price for iPhones during the quarter was nearly $800, up from $695 in the same quarter a year earlier, hinting at the impact of the pricier model.

Apple CEO Tim Cook said the iPhone X "has been our top-selling iPhone every week since it shipped in November."

Related: Apple is set to report a giant profit. But iPhone X demand worries investors

The stock had slipped in the days leading up to its earnings report as analysts and media outlets raised concerns about demand for the iPhone X after the holidays.

The company is rumored to be cutting production for the $999 smartphone by half for the first three months of 2018, according to multiple reports. The lower sales forecast only adds to those jitters.

Apple stock rose as much as 3% in after hours trading Thursday following the earnings report.

Apple had gone several years without making a major change to the iPhone's look and feel before releasing the tenth anniversary edition iPhone X. The phone features a full bleed screen and offers the option to unlock the device by scanning your face.

Investors had hoped that the vastly redesigned device would help drive a "super cycle" of customers upgrading their smartphones. Now analysts are questioning Apple's strategy.

"Apple stumbled in its most recent effort to expand the iPhone product line with 2 new models in 2017 (iPhone 8 and iPhone X), one potential cause of the iPhone unit miss," said Gene Munster, an Apple analyst and managing partner at Loup Ventures.

On a conference call with analysts, Apple executives were also pressed on the impact that offering more affordable iPhone battery replacements may have on smartphone upgrades. The replacements came after an outcry over Apple slowing down the performance of older iPhone models.

"Sitting here today, I don't know what effect it will have," Cook said. "It was not in our thought process."

Even if iPhone sales disappoint, Apple investors may get a pleasant surprise from the tax bill signed late last year. The new law makes it cheaper for Apple to bring back the cash it holds overseas.

Apple had $285 billion in its cash pile last quarter, $269 billion of which is held offshore. Much of that money is expected to be returned to shareholders.

"We have now the flexibility to deploy this capital," Luca Maestri, Apple's CFO, said on the call. "We will do that over time because the amount is very large."

Apple announced a dividend of $0.63 per share on Thursday. Last month, Apple said it would invest $30 billion in U.S. facilities over the next five years and create 20,000 jobs in the country.