Investors boosted Apple's stock 4.6 percent to $209.97 Tuesday in after-hours trading after the company forecast its third-quarter revenue higher than analysts' expectations, indicating stabilizing iPhone demand, and raised dividend.

The stock opened at $203.06 and hit a high of $203.40. Its after-hours spike brought it close to the $1 trillion valuation the company first reached in August 2018.

The Cupertino-based tech giant reported Q2 results above market expectations but the key iPhone revenue fell 17 percent.

Apple posted quarterly revenue of $58 billion, a drop of 5 percent from the year-ago quarter. Quarterly earnings per share fell 10 percent to $2.46. International sales accounted for 61 percent of the quarter’s revenue.

The company said iPhone revenue was 17.33 percent lower year-over-year. iPhone revenue accounts for 53.5 percent of Apple’s revenue in the quarter, which is lower than it has historically been.

Apple’s earnings report was in line with analysts’ estimates on many counts, however. Its guidance for the third quarter was higher than analysts expected. Apple CEO Tim Cook said the board had authorized an additional $75 billion for share repurchases.

“We are also raising our quarterly dividend for the seventh time in less than seven years,” he said.

Apple’s performance against analysts’ estimates:

EPS: $2.46 vs. $2.36 forecast by Refinitiv consensus estimates

Revenue: $58.02 billion vs. $57.37 billion by Refinitiv

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

Q2 iPhone revenue: $31.05 billion vs. $31.10 billion forecast by FactSet consensus estimates

Projected Q3 revenue: $52.5 to $54.5 billion vs. $51.94 billion forecast by Refinitiv consensus estimates

“Our March quarter results show the continued strength of our installed base of over 1.4 billion active devices, as we set an all-time record for Services, and the strong momentum of our Wearables, Home and Accessories category, which set a new March quarter record,” said Cook.

“We delivered our strongest iPad growth in six years, and we are as excited as ever about our pipeline of innovative hardware, software and services. We’re looking forward to sharing more with developers and customers at Apple’s 30th annual Worldwide Developers Conference in June.”

Apple issued guidance for its fiscal third quarter that was higher than expected. Analysts said this suggests demand for the iPhone is stabilizing again while services revenue continues to grow.

apple logo
An Apple logo is displayed in an Apple retail store in Grand Central Terminal, January 29, 2019 in New York City. Drew Angerer/Getty Images

Apple’s sales in China did improve over the previous quarter and exhibited greater strength towards the end of the quarter. 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,” he explained.

Apple said that it had $10.22 billion in sales in Greater China, which also includes Taiwan and Hong Kong.