Apple Inc. had the best quarter of any publicly-traded company in history, it announced shortly after the market closed Tuesday. Record sales of the iPhone propelled Apple to its most successful quarter so far, raking in $18 billion in net profits for its fiscal first quarter.

The iPhone maker's profits surged as it sold 74.5 million smartphones in the three months ending Dec. 27, beating analyst expectations. Apple beat a previous record held by energy giant ExxonMobil, which earned $15.9 billion in the second quarter of 2002, according to Standard & Poor’s.

Apple does not give a breakdown of sales for individual iPhone models, but analysts had said demand for the bigger and higher-priced iPhone 6 Plus would help increase gross margin, or the profit Apple makes on each device. Apple said gross iPhone margins rose 2 percent to 39.9 percent in its first quarter.

“We’d like to thank our customers for an incredible quarter, which saw demand for Apple products soar to an all-time high,” CEO Tim Cook said in a statement regarding earnings, congratulating the efforts of Apple employees.

Cook said demand for iPhones was “staggering” in a call to discuss earnings, but iPad sales fell by 18 percent from the same period last year. He expects the company’s first smartwatch, the Apple Watch, to be available in April.