Microsoft beat Wall Street's profit forecast as computer sales held up better than expected, lifting its shares 2.5 percent after hours.
The world's largest software maker reported quarterly profit of $5.11 billion, or 60 cents per share, compared with $5.23 billion, or 61 cents per share, in the year-ago quarter when it posted a one-time tax gain.
Profit beat analysts' average forecast of 57 cents per share, according to Thomson Reuters I/B/E/S.
Sales rose 6 percent to $17.41 billion, driven by strong demand for its server software products and Office application. Analysts had expected sales of $17.18 billion.
Worldwide personal computer sales rose a modest 1.9 percent in the quarter, according to tech research firm Gartner Inc. That was better than expected in a market facing hard-drive shortages from Thailand and the onslaught of Apple's iPad.
That helped Microsoft, which supplies the operating system for 90 percent of PCs, to post a 4 percent increase in sales of Windows, still its main product.
"The Windows beat was a positive surprise, looking at about 4 percent growth, versus expectations for about a 4 percent decline," said Josh Olson, an analyst at Edward Jones.
"We also had solid business and server performance as well. The Big Three, if you will, in terms of the revenue drivers, were all a little bit better than expected, with Windows a lot better than expected."
On the downside, Microsoft's usually profitable entertainment and devices unit posted a quarterly loss due to falling sales of its aging Xbox console and increased research and marketing costs for its new Windows smartphone software.
Microsoft shares rose to $31.87 in extended trading, after closing at $31.01 on Nasdaq.
The stock is up 20 percent so far this year, outpacing the tech-heavy Nasdaq's 16 percent gain, and a 10 percent rise in the Standard & Poor's 500.