Updated from 5:23 p.m. EDT

Apple ( AAPL) boosted fourth-quarter profit by 26% on strong iPhone sales and higher margins.

But the company's normally conservative forecast for the current quarter seemed to be lowballed more than usual, with the company noting a challenging environment ahead for financial forecasting.

Apple said fourth-quarter net income rose to $1.14 billion, or $1.26 a share, compared with $904 million, or $1.01 a share, a year earlier.

Revenue rose to $7.9 billion from $6.22 billion in the same period last year.

Analysts had predicted revenue of $8.05 billion and earnings of $1.11 a share.

Gross margins rose to 34.7% from 33.6% a year earlier.

Apple said it shipped 2.6 million Macs, slightly below consensus expectations of 2.7 million, representing revenue growth of 17%.

The company sold 6.9 million iPhones, which was way ahead of average estimates of 4.5 million.

The company's iPod was more problematic, however. While the company sold 11.1 million of the devices during the quarter, it appeared that cost cuts bit into iPod revenue, which rose only 3% from a year ago and was down 1% sequentially, despite the back-to-school quarter.

"Looking ahead, visibility is low and forecasting is challenging, and as a result we are going to be prudent in predicting the December quarter," said Peter Oppenheimer, Apple's CFO, in a statement.

For the first quarter, Apple said it expected earnings of $1.06 to $1.35 a share on revenue of $9 billion to $10 billion.

Analysts were expecting the company to earn $1.65 a share on revenue of $10.57 billion.

Shares of Apple were up 4.1% in recent after-hours trading to $95.25.

If you liked this article you might like

What's Up With Apple?

AI Pioneer Andrew Ng: There's Room for Multiple Winners in the AI Race

How to Make Your Life Successful Just Like Billionaire Warren Buffett

Watch Out For the Dominoes That Fall: Cramer's 'Mad Money' Recap (Wed 9/20/17)