(Carl Court/Getty Images)

In case you had started to doubt it: People still love the iPhone.

Apple announced Tuesday that it sold 78.2 million iPhones in its fiscal first quarter — a record for any single quarter in the company's history. The tech giant had concerned analysts with a few weak quarters that raised doubts about the iPhone's staying power. Apple returned to growth for the first time in three quarters.

Though its profits slipped 2.6 percent from the same time last year, Apple touted a record-breaking $78.4 billion in revenue. Both Apple’s profit and revenue beat analysts’ expectations. 

“We’re thrilled to report that 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 Tim Cook, Apple’s chief executive.

The iPhone was the main force behind Apple’s record revenue. Sales of the smartphones made up 69 percent of Apple’s revenue in its first quarter, and they were up 5 percent from the same time last year.

Consumers still turned out to buy the iPhone 7 and iPhone 7 Plus, even though Apple didn’t deliver as significant an update to the phone line as many had expected. The firm is expected to release a major upgrade this year to mark the device’s 10th anniversary.

But with good reviews, and perhaps buoyed by problems at its archrival Samsung, Apple led the smartphone market with the iPhone 7 this past holiday season, according to research firm Strategy Analytics.

Still, the forecast isn’t completely rosy for the iPhone — at least in terms of competition with Android devices. Research firm eMarketer expects that Apple’s hold on the U.S. smartphone market will stay just about the same in 2017, with a 43.7 percent market share vs. 52.2 percent for Android phones. The company also expects Android to remain the dominant platform through 2019.

As Cook noted, it was a good quarter for Apple hardware. The Mac line, which saw a laptop refresh, grew 7 percent year-over-year. But sales of the iPad continued to slide, down 22 percent from the first quarter last year.

Apple’s services business, which includes the App Store and iTunes store, saw revenue rise 18 percent from the same time last year. Cook said he expects that this segment will double over the next four years.

Shares of the company were up more than 3 percent from Tuesday’s close of $121.35 in after-hours trading, after the report was released.