The iPhone is back in business.

After three quarters of sinking iPhone sales, Apple on Tuesday reported that sales of the iPhone in the quarter ending Dec. 31 set all-time revenue records, thanks in part to the holiday season.

While consumer spending has been relatively strong, fashion merchants have been missing out as shoppers turn to tech companies, like Apple, and favor experiences over the latest style.

Apple’s net profits slipped slightly to $17.9 billion from $18.4 billion a year earlier. However, because of a decrease in the number of shares outstanding as the company bought back stock, earnings per diluted share rose, to $3.36 from $3.28.

Sales for the three months ended Dec. 31 increased 3.3 percent to $78.4 billion.

“Our holiday quarter results generated Apple’s highest quarterly revenue ever, and broke multiple records along the way. We sold more iPhones than ever before and set all-time revenue records for iPhone, Services, Mac and Apple Watch,” said chief executive officer Tim Cook.

In a call with investors, Cook said that it had been the best quarter ever for Apple Watch in terms of both units and revenue, and that Apple could not keep up with demand for the smartwatch during the holiday season.

Apple Watch is the best-selling smartwatch in the world and also with the highest customer satisfaction in its category by a wide margin,” Cook said. “Apple Watch is the ultimate device for a healthy life and it is the gold standard for smartwatches.”

He also remarked on the strong demand for the iPhone 7 Plus, which made up a higher portion of the new product mix than Apple has had with previous plus models. In the quarter, Apple sold 78.3 million iPhone units, marking a 5 percent increase from last year and an all-time record.

Cook said that two million merchants now accept Apple Pay online and that early feedback to Air Pods, Apple’s new wireless ear buds, had been positive.

Apple chief financial officer Luca Maestri said that the company’s retail stores experienced double-digit growth in visitors in the quarter and that Apple would continue to expand its global presence with new stores.