Microsoft Corp
Shares rose 3.1% to $44.70 in after-hours trading.
"The company beat across the board," said FBR Capital markets analyst Daniel Ives. "The Street will cheer these results as it appears Microsoft is back on the right track after a head-scratching performance last quarter."
Sales of Windows to computer manufacturers to install on new PCs fell 19% in the quarter, reflecting a sharp dip from a year ago when Windows got a brief boost from consumers rushing to buy new machines after Microsoft stopped support for the 14-year-old XP operating system.
That decline was offset by higher revenue from its Surface tablet, back-end server software and cloud-related offerings such as its online Office 365 suite of applications.
The company said its commercial cloud-related revenue for the quarter more than doubled, and was now running at $6.3 billion a year. Amazon.com Inc
More From This Section
Microsoft's overall revenue rose 6% to $21.7 billion, above Wall Street's average forecast of $21.1 billion, according to Thomson Reuters I/B/E/S.
Taking out the effects of the strong US dollar on currency rates, Microsoft said revenue would have risen 9%.
Earnings per share declined to 61 cents per share from 68 cents in the year-ago quarter. Analysts had expected 51 cents, on average.