Apple's sales are still shrinking amid weakening iPhone demand, despite the company's effort to emphasize services designed to bring in a steady flow of money from the 1.4 billion of its devices still in use.

Revenue for the January-March quarter fell 5 percent from the same time in 2017 to $58 billion, the company said in its earnings report Tuesday. That downturn followed a 5 percent drop in the previous quarter.

It's the first time Apple has suffered two consecutive quarterly revenue declines in two-and-half years.

Apple still posted a profit of $11.6 billion during its latest quarter, though that was down 16 percent compared to last year. That translated into $2.46 per share, down 10 percent from last year, but above the $2.36 per share forecast among analysts surveyed by FactSet.

The Cupertino, California, company also announced a 5 percent increase in its quarterly dividend to 77 cents per share.

That news, coupled with results that weren't quite as bad as analysts had feared, seemed to please investors.

Apple's stock gained more than 5 percent to $211.50 in after-hours trading, following a company forecast that signaled the revenue slump may be ending in the current April-June quarter.