Apple reported its first year-over-year quarterly decline in sales of the iPhone, its dominant product, as the company reported second-quarter results on Tuesday.

The company said it sold 51.2 million iPhones in the quarter, down from 61.2 million in the same quarter a year ago. Despite the drop, the result was still above the forecasts of analysts, who had been expecting Apple to report iPhone sales of about 50 million units.

Overall, Apple reported revenue of $50.5 billion US, down from $58 billion a year earlier. Apple had not seen a revenue drop since 2003. Sales of iPhones accounted for 65 per cent of Apple's revenues in the quarter that concluded at the end of March.

Troy Crandall, equity analyst at 3Macs in Montreal, said the year-over-year sales comparisons for the iPhone were "tough" because last year's figures included the initial sales of the iPhone 6 and 6 Plus.

The company said it made a profit of $1.90 per share, a drop from the $2.33 it made in the same quarter of last year. Analysts had been expecting the company to make $2 a share.

Apple also offered a softer outlook for the third quarter. The Cupertino, Calif.-based company said it expects to report revenues between $41 billion and $43 billion. Wall Street's consensus forecast was for $47.3 billion.

In the wake of the earnings news, investors sent Apple shares down more than eight per cent.

Apple said it sold 10.25 million iPads during the most recent quarter, a drop of 19 per cent.

One relative bright spot was Apple's services group, including iTunes, the App Store, and Apple Music. Services revenue was up 20 per cent year-over-year. Apple Music's subscriber base grew by 2 million during the quarter to reach 13 million.

The company also announced an increase to its capital return plan, which includes dividends and share repurchases, by $50 billion US. Apple said it now plans to return $250 billion US to shareholders by the end of March 2018.