Apple (AAPL) shares surged in after-hours trading after it beat earnings forecasts and doubled the amount of cash it will return to shareholders. However, its outlook fell short of expectations.
Apple reported fiscal second-quarter earnings of $10.09 a share on revenue of $43.60 billion versus $12.30 a share on $39.19 billion a year earlier.
Analysts had expected the tech giant to report earnings excluding items of $10.00 per share on revenue of $42.33 billion, according to a consensus estimate from Thomson Reuters.
Apple sold 37.4 million iPhones in the quarter, compared with 35.1 million in the year-ago quarter. The tech company sold 19.5 million iPads versus 11.9 million a year earlier.
But the company's gross margin shrank to 37.5 percent compared to 47.4 percent a year earlier.
For the third quarter, Apple forecast revenue of between $33.5 billion and $35.5 billion, well below the $38.25 billion Wall Street was forecasting. It also expects its gross margin to continue to slide to between 36 percent and 37 percent.
Apple also increased its dividend 15 percent to $3.05 a share and said it will expand its share repurchase program to $60 billion from the $10 billion level announced last year.
More From CNBC