Consumer electronics giant Apple (AAPL) late Thursday beat Wall Street’s targets for sales and earnings for the company fiscal fourth quarter and guided to higher-than-expected sales for the current quarter.

Apple reported earnings per share of $2.07, up 24% year over year, on sales of $52.6 billion, up 12%, for the period ended Sept. 30. Analysts expected earnings of $1.87 a share on sales of $50.79 billion.

Apple sold 46.7 million iPhones in the quarter, vs. analyst expectations for 46 million units.

Apple shares rose 3.2% in after-hours trading on the stock market today. During the regular session, Apple rose 0.7% to 168.11. Apple hit an all-time high of 169.94 on Wednesday.

For the current quarter, Apple’s first of 2018, it expects revenue of $85.5 billion, topping consensus estimates, based on the midpoint of its guidance. Apple did not give an earnings forecast for the first quarter. Wall Street was modeling earnings of $3.77 on sales of $85.31 billion.

“We’re happy to report a very strong finish to a great fiscal 2017, with record fourth-quarter revenue, year-over-year growth for all our product categories, and our best quarter ever for Services,” Chief Executive Tim Cook said in a news release.

Cook went on to say: “With fantastic new products including iPhone 8 and iPhone 8 Plus, Apple Watch Series 3, and Apple TV 4K joining our product lineup, we’re looking forward to a great holiday season, and with the launch of iPhone X getting underway right now, we couldn’t be more excited as we begin to deliver our vision for the future with this stunning device.”