The Microsoft Corporation's headquarters in Issy-les-Moulineaux, near Paris, glimmers in the sun.

Redmond, Washington - Microsoft said on Thursday that an accounting adjustment to reflect a weak online ad business led to its first quarterly loss in its 26 years as a public company.

The software company had warned that it was taking a $6.2-billion charge because its 2007 purchase of online ad service aQuantive hasn't yielded the returns envisioned by management. The non-cash adjustment is something companies do when the value of their assets decline.

Microsoft paid $6.3-billion for aQuantive, only to see rival Google expand its share of the online ad market.

The charge led to a $492-million loss in the April-June quarter, or six cents a share. That compares with earnings of $5.9-billion, or 69 cents, a year ago.

Revenue rose four 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 48 cents, or 1.6 percent, at $31.10 in after-hours trading following the release of earnings results. - Sapa-AP