Despite the earnings beat and gross margins that exceeded forecasts, shares of the iPad and Mac maker slumped about 6% in after-hours action.

Apple said it earned $13.07 billion, or $14.50 a share, last quarter, compared with a profit of $13.08 billion, or $13.81 a share, a year earlier. Analysts had expected EPS of $14.07.

Revenue rose 5.6% to $57.59 billion, narrowly topping the Street’s view of $57.46 billion. Gross margins ticked down to 37.9% from 38.6% a year earlier, beating forecasts from analysts for 37.3% and exceeding the high end of management’s guidance.

Apple said it shipped a record 51 million iPhones last quarter, which is below consensus calls from analysts for 54.6 million. Still, that represents a 6.8% jump from the year before when it sold 47.79 million devices.

The tech giant said it sold 26.04 million iPads during the fiscal first quarter, up from 22.86 million the year before. That exceeded the 24.9 million tablet devices that analysts had projected.

"We are really happy with our record iPhone and iPad sales, the strong performance of our Mac products and the continued growth of iTunes, Software and Services," Apple CEO Tim Cook said in a statement.

Looking ahead, Apple projected fiscal second-quarter revenue of $42 billion to $44 billion, which is below the Street’s view of $46.12 billion. Apple is known for issuing relatively conservative guidance that the company often easily exceeds.

The consumer electronics giant projected second-quarter gross margins of 37% and 38% as well as operating expenses of between $4.3 billion and $4.4 billion.

Apple said it returned $7.7 billion in cash to shareholders through dividends and share buybacks last quarter, bringing cumulative payments under the company’s current program to more than $43 billion.

Still, Apple has been under pressure from billionaire investor Carl Icahn, who has pushed the company to deploy more of its cash stockpile on shareholder-friendly moves like stock buybacks.

The legendary corporate raider revealed buying another $500 million of Apple shares last week. Icahn told FOX Business: “We think it’s really, very undervalued and the board is doing a major disservice by not using the greatest cash hoard in history” to buy back more shares. “It’s almost criminal,” he said of Apple’s reluctance on increased share repurchases.

Earlier on Monday, BGC Financial analyst Colin Gillis downgraded Apple to “hold” from “buy,” noting that the good news appears to be “priced in.” Gillis slapped a “buy” rating on Apple back in April, preceding a 37% rally for the tech giant.