Apple sales technicians confer in front of Apple product advertisements in the World Trade Center in New York City. Robert Nickelsberg | Getty Images

Apple reported earnings for its March quarter Tuesday that were above expectations, although revenue was down from the same period last year. However, Apple's guidance for next quarter was higher than analysts expected, and it said it planned to spend $75 billion buying back its own shares. Apple stock spiked over 4% and it approached a $1 trillion market value in extended trading. Here's how the company did compared to what Wall Street expected: EPS : $2.46 vs. $2.36 forecast by Refinitiv consensus estimates

: $2.46 vs. $2.36 forecast by Refinitiv consensus estimates Revenue : $58.02 billion vs. $57.37 billion forecast by Refinitiv consensus estimates

: $58.02 billion vs. $57.37 billion forecast by Refinitiv consensus estimates Q2 iPhone revenue : $31.05 billion vs. $31.10 billion expected forecast by FactSet consensus estimates

: $31.05 billion vs. $31.10 billion expected forecast by FactSet consensus estimates Q2 services revenue : $11.45 billion vs. $11.37 billion forecast by FactSet consensus estimates

: $11.45 billion vs. $11.37 billion forecast by FactSet consensus estimates Projected Q3 revenue: $52.5 to $54.5 billion vs. $51.94 billion forecast by Refinitiv consensus estimates Apple's total sales were down 5% from the same period last year, although it doesn't seem to matter to investors as the stock is up. Guidance for Apple's fiscal third quarter was higher than expected, suggesting Apple's iPhone demand machine is stabilizing again and that services revenue continues to grow. In January, Apple cut its first-quarter forecast, blaming slow iPhone sales in China. iPhone revenue was also down 17.33% year-over-year. iPhone revenue accounted for 53.5% of Apple's revenue for the quarter, which is lower than it has historically been.

Improvements in China

In an interview with CNBC's Josh Lipton, CEO Tim Cook said that Apple's performance in China had improved over the previous quarter and saw greater strength towards the end of the quarter. Cook also said that a sales tax cut had helped decrease the price of Apple products, which had helped. Cook said that the trade relationship between the U.S. and China had improved as well. "I believe that the trade relationship — I don't mean the tariff, I mean the tone — is much better today than it was in the November-December time frame. That affects consumer confidence in a positive way," Cook said. Apple said that it had $10.22 billion in sales in its Greater China category, which also includes Taiwan and Hong Kong. The improvement in the China region may be one reason for Apple's strong next-quarter guidance, which was significantly higher than analysts expected. Apple blamed iPhone sales in China for a revenue shortfall in the December quarter. "The June guidance was a jaw dropper in terms of strength and speaks to Cook and Cupertino getting back their sea legs after the December debacle," Wedbush analyst Dan Ives said.

Major capital return

Apple also said that it would spend $75 billion on share repurchases and it also approved a 77 cent dividend per share, a 5% increase. Apple announced that it would spend $100 billion during this period last year. Cook said that Apple had returned $27.5 billion to shareholders last quarter. Apple has recently been signaling to investors that iPhone sales aren't the critical number to watch. Apple instead is highlighting its services revenue, which includes products like iCloud, Apple Music, AppleCare warranties and others. Apple reported $11.45 billion in services revenue, which is up 16% from the same time last year. "We'll have Apple Arcade and Apple TV+ in the market in the fall, and Apple Card will go out during the summer timeframe. We're very excited about getting these out there," Cook said during a call to discuss the earnings. When asked about which new service he thought would be the most financially meaningful, Cook said: "We wouldn't do a service that wouldn't be meaningful, these aren't hobbies." Apple isn't providing a new installed base figure from its last update of 1.4 billion devices, but Cook did say that it hit an all-time record last quarter across all categories.

Strong wearables performance