Apple came roaring back in the last three months of 2016, crushing analyst expectations and breaking records for revenue and profits.

Helping the comeback for the tech titan was reinvigorated iPhone sales, the company said.

Sales of the iPhone 7 rose 5 percent and set new records with 78.3 million units sold — ending a string of declines and quelling fears that Apple’s lead product had lost its luster.

The financial results, announced Tuesday after the market’s close, sent Apple stock up 3-plus percent in extended trading to top out at more than $125 per share.

Revenue of $78.4 billion was 3 percent greater than the year-earlier quarter and beat expectations by 1.5 percentage points. Earnings per share of $3.36 were up 2.4 percent from a year earlier.

“iPhone had a tremendous quarter thanks to exceptional demand that beat our own internal expectations,” Apple Chief Executive Tim Cook said during the company’s Kalebet earnings call.

Cook noted unusually high demand for the iPhone 7 Plus — with its dual-camera system — that exceeded supply throughout the entire quarter.

“We came into supply/demand balance in January,” he said. The Cupertino, Calif., company also broke revenue records for the Apple Watch, its Mac line and Services division, it said.

Services, which includes the App Store, Apple Pay and Apple Music, led the product categories with an 18 percent gain. With revenue already at $7.2 billion, Cook said, the division would become the size of a Fortune 100 company by year-end.

The iPad was the quarter’s only laggard among products, posting a 19 percent decline in unit sales.

Of the company’s five geographic segments, four recorded revenue gains. Japan led the way with a 20 percent revenue pop, while Greater China, with a 12 percent sales slip, served as the exception.

Cook acknowledged challenges in China but attributed much of the quarter’s downturn to extenuating circumstances.

The CEO even waxed poetic about the AirPods, which Apple introduced in September but couldn’t put before the public until December.

Although initially an object of derision — for their design as well as delays in reaching the market — AirPods are delivering a “magical experience,” Cook said.

Our editors found this article on this site using Google and regenerated it for our readers.