The software company had warned that it was taking a $6.2 billion charge because its 2007 purchase of online ad service aQuantivehasn't yielded the returns envisioned by management. The non-cash adjustment is something companies do when the value of their assets decline. Microsoft Corp. paid $6.3 billion for aQuantive, only to see rival Google Inc. expand its share of the online ad market.
The charge led to a $492 million loss in the April-June quarter, or 6 cents a share. That compares with earnings of $5.9 billion, or 69 cents, a year ago.
Revenue rose 4 percent to $18.06 billion.
Excluding the adjustment and the deferral of some revenue into the current quarter related to its launch of Windows 8, earnings came to 73 cents per share, beating the 62 cents per share expected by analysts polled by FactSet.
Although the earnings were higher than expected, analysts were looking for higher revenue at $18.15 billion.
Shares were up 65 cents, or 2.1 percent, at $31.32 in after-hours trading following the release of earnings results.
Microsoft, which is based in Redmond, Wash., has never previously reported a quarterly loss since the company's initial public offering in March 1986. The aQuantive-driven setback isn't likely to faze investors, who usually focus on what lies ahead for a company instead of dwelling on past mistakes.
Microsoft's fortunes are tied to the October release of Windows 8, the most extreme redesign of the company's flagship operating system since 1995. Windows 8 will feature a new look that will show applications in a mosaic of tiles and boast new technology that will enable the operating system to work on touch-controlled tablet computers, as well as its traditional stronghold on desktop and laptop computers. In conjunction with Windows 8, Microsoft is planning to release its own tablet, the Surface.
A revamped version of another lucrative franchise, Microsoft's Office software that bundles word processing, spreadsheet and email programs, is also in the works. Earlier this week, Microsoft previewed how the next version of Office, expected to be released next year, will work on tablet computers running on Windows 8.
With Windows 8-powered devices still a few months away, some prospective PC buyers have been postponing their purchases so they can buy the latest technology from Microsoft this fall. That's contributed to a slowdown in PC sales, and revenue in Microsoft's Windows division has now dropped in five of the past seven quarters.
The pressure won't be on Microsoft until Windows 8 is released on Oct. 26. Investors will then be closely watching to see if the new operating system delivers on its goal of making Microsoft a significant player in the rapidly growing tablet computer market currently dominated by Apple Inc.'s iPad, while also helping boost PC sales.
The high hopes for Windows 8 are the main reason Microsoft's stock has climbed about 18 percent this year as of Thursday's closing price of $30.67.