Apple once again posted an, until now, rare revenue decline in its latest fiscal quarter, but said its overall business improved from the December quarter and sales of its iPhones were solid.

The results reported Thursday were better than Wall Street’s muted expectations and Apple’s stock (AAPL) rose in after-hours trading.

Mass layoffs at Apple? That’s a ‘last resort,’ says CEO Cook

The latest numbers come after the Cupertino, California, company in February posted its first quarterly revenue drop in nearly four years after pandemic-driven restrictions on its China factories curtailed sales of the latest iPhone during the holiday season.

Apple said it earned $24.16 billion, or $1.52 per share, in the three-month period that ended April 1. That was down slightly from $25.01 billion, also $1.52 per share, a year earlier.

Revenue fell 3% to $94.84 billion from $97.28 billion.

Analysts, on average, were expecting earnings of $1.43 per share on revenue of $92.91 billion, according to a poll by FactSet.

For the current, fiscal third quarter, Apple said it expects revenue performance to be “similar” to the second quarter. Analysts are forecasting $84.5 billion, which is well below what Apple is suggesting.

Apple said iPhone sales brought in $51.33 billion in revenue in the first quarter. Analysts expected a more modest $48.66 billion. Revenue in its key services division was $20.91 billion, slightly above Wall Street’s estimates of $20.66 billion.

Tim Cook: Apple already using AI but development requires ‘deliberate and thoughtful’ progress

CEO Tim Cook said in a conference call that Apple is seeing “ongoing challenges” related to the broader economic environment but the company continues to “manage for the long term.”

Unlike many of its tech industry peers, Apple hasn’t signaled any intention to resort to mass layoffs. Industry giants such as Google parent Alphabet, Microsoft, Amazon and Facebook parent Meta Platforms have announced plans to jettison tens of thousands of employees in recent months as they adjust to revenue slowdowns or downturns caused by people’s lessening dependence on the digital realm as pandemic restrictions have eased.

Wedbush analyst Dan Ives said Apple delivered a “LeBron-like March,” referring to the basketball star LeBron James.

“The iPhone beat was front and center,” Ives said, adding that it’s a clear indication that the company is continuing to gain market share in China.

The company said its board also approved a $90 billion share buyback program and raised its regular quarterly dividend by 4% to 24 cents a share.

Apple’s shares climbed about 2% in after-hours trading.