LOS ANGELES, Calif. - Microsoft has posted its first quarterly loss in its 26 years as a public company as it declared a struggling online ad business a bust and prepared for one of the biggest product updates in its history.

The software company had warned two weeks ago that it would take a $6.2 billion charge in the April-June quarter because its 2007 purchase of online ad service aQuantive failed to help it compete with Google Inc. The amount reflected the bulk of the $6.3 billion it paid for aQuantive.

The purchase of aQuantive, Microsoft's most expensive deal at the time, was supposed to help Microsoft boost its online ad business and mount a more serious challenge to Google. But the division housing aQuantive continued to post losses — totalling more than $9 billion since the company bought aQuantive, not including the charge.

By contrast, Google has widened its lead in the growing online ad market, thanks in part to its purchase of DoubleClick for $3.2 billion about eight months after Microsoft took control of aQuantive.

Google's search engine, a major vehicle for selling ads, has remained strong, while Microsoft's Bing search engine saw its market share drop slightly to 26 per cent, from 27 per cent a year ago. The Bing figures include searches through business partner Yahoo Inc., which has been using Microsoft's search technology for nearly two years.

The aQuantive setback didn't faze investors, who have been used to years of troubles in Microsoft's online ad business. Investors usually focus on what lies ahead for a company instead of dwelling on past mistakes. Despite the loss, Microsoft's stock was up 72 cents, or 2.4 per cent, at $31.39 in after-hours trading following the announcement.

Microsoft's fortunes are now tied to the Oct. 26 release of Windows 8, the most extreme redesign of the company's flagship operating system since 1995. Windows 8 will feature a new look and boast new technology that will enable the operating system to work on touch-controlled tablet computers, as well as Microsoft's traditional stronghold of 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 will work on tablet computers running on Windows 8.

Microsoft, which is based in Redmond, Washington, has never previously reported a quarterly loss since the company went public in March 1986.

The $6.2 billion charge is a non-cash adjustment, which companies do when the value of their assets decline. Companies have to review their assets once a year, and the just-ended quarter is Microsoft's final one for fiscal 2012.

With the charge, Microsoft had a $492 million loss in the fiscal fourth quarter, or 6 cents a share. That compares with earnings of $5.9 billion, or 69 cents, a year ago.

Revenue rose 4 per cent to $18.06 billion.

Excluding the adjustment and the deferral of some revenue related to 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.

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. Microsoft said PC sales were flat in the just-ended quarter, 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 in three months. Investors will then be closely watching to see if the new operating system delivers on its goal of making Microsoft a significant player in a tablet computer market dominated by Apple'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 per cent this year as of Thursday's closing price of $30.67.

Related on HuffPost:

Loading Slideshow...
  • Touch Cover

    Typing on tablet computers can be a struggle for those accustomed to PC's physical keyboards. Microsoft Surface offers a solution with a lightweight keyboard attachment that clicks into place and doubles as a cover for the device. <a href="http://www.microsoft.com/en-us/news/press/2012/jun12/06-18announce.aspx" target="_hplink">According to a Microsoft press release</a>, the 3mm detachable Touch Cover unfolds into a "unique pressure-sensitive" keypad that offers an alternative to the device's on-screen virtual keyboard. For those who crave the feel of physical keys, a 5mm-thin version, called the Type Cover, features moving keys and a <a href="http://www.wired.com/gadgetlab/2012/06/microsoft-dives-head-first-into-mobile-hardware-with-a-pair-of-10-6-inch-tablets/" target="_hplink">multi-touch track pad</a>.

  • Options For Casual And Power Users

    Before picking up a Surface tablet, potential buyers should <a href="http://www.microsoft.com/global/surface/en/us/renderingassets/surfacespecsheet.pdf" target="_hplink">consider which version best fits their needs</a>: The Windows RT version, a more traditional tablet that's slim and light and performs basic tasks -- with a presumably iPad-like price tag; or the Windows 8 Pro configuration, a slightly beefier and slightly pricier tablet that's more closely related to a laptop and capable of running heavy-duty software. <br></br> <a href="http://www.microsoft.com/global/surface/en/us/renderingassets/surfacespecsheet.pdf" target="_hplink">Surface tablets running Windows RT</a> are built around an ARM processor. <a href="http://money.cnn.com/2012/03/09/technology/arm-ipad-intel/index.htm" target="_hplink">According to CNN,</a> chipsets made by ARM are found in 95 percent of other mobile devices, including the iPad. <a href="http://www.microsoft.com/global/surface/en/us/renderingassets/surfacespecsheet.pdf" target="_hplink">Windows 8 Pro models</a> are built around an Intel chip and will run applications that one would expect to find on traditional laptops: <a href="http://www.pcworld.com/article/257840/microsoft_announces_surface_tablet_pc.html" target="_hplink">Photoshop, Word, and Excel.</a> <br></br> "Those looking for a complete Windows experience in the form of a tablet will obviously need to pony up for the Windows 8 Pro model," <a href="http://www.engadget.com/2012/06/18/microsoft-surface-tablets-the-differences-between-rt-and-window/" target="_hplink"> Engadget writes.</a>

  • Integrated Kickstand

    Microsoft is keen on packing convenience into its new devices. Each Surface comes with a built-in kickstand that pops out from the back panel and props the device at an angle, letting the user enjoy media or type comfortably on a flat surface. "No extra weight, no extra thickness, no separate add-on. It's integrated, just like the software and hardware are integrated into Surface," said Windows and Windows Live president Steven Sinofsky, <a href="http://www.youtube.com/watch?v=jozTK-MqEXQ" target="_hplink">per the Verge's video of the Surface unveiling</a>.

  • Digital Ink And Stylus

    Microsoft designed the <a href="http://www.microsoft.com/global/surface/en/us/renderingassets/surfacespecsheet.pdf" target="_hplink">Windows 8 Pro version</a> of the Surface tablet to accept stylus input. The company's demonstration of how the digital ink works gave the impression that writing, highlighting and underlining on the tablet is easy. <a href="http://www.slashgear.com/microsoft-surface-to-feature-digital-ink-stylus-support-18234493/" target="_hplink">Writes SlashGear</a>, "The distance between the screen (digitizer) and the stylus is only .7mm thick, and allows for it to be highly accurate, making you feel like the ballpoint of a pen is actually writing on the 'surface.'"

  • Microsoft Office

    Both the RT and Win 8 Pro versions of Surface will run the Microsoft Office productivity suite, though the Windows RT version <a href="http://www.pcworld.com/article/257840/microsoft_announces_surface_tablet_pc.html" target="_hplink">will get a mobile-optimized app</a>, instead of the full program. Meanwhile, iPad owners must settle for <a href="http://www.engadget.com/2012/06/05/nyt-office-for-ipad-is-still-on/" target="_hplink">speculation of the long-rumored native iOS Office app.</a>.

  • USB Ports

    Plenty of people weren't happy when the iPad launched <a href="http://store.apple.com/us/question/answers/ipad?tqid=QJ9CA7CXXFHDFUUU7PT47A24U4YAUH79K" target="_hplink">without USB ports back in 2010.</a> Microsoft seems to have taken that to heart. The <a href="http://www.microsoft.com/global/surface/en/us/renderingassets/surfacespecsheet.pdf" target="_hplink">width of the Surface</a> offers just enough space for a traditional USB. Both the RT and the Windows 8 Pro versions of Surface boast two USB ports. "These ports open up the possibility of extra storage, printing and other external capabilities that should be easier and quicker than the workarounds iPad users need involving cloud storage, Wi-Fi connections and the like," <a href="http://www.cnn.com/2012/06/19/tech/microsoft-surface-ipad/index.html" target="_hplink">CNN reports.</a>

  • An Angled Approach

    Just like the iPad, the Surface tablet includes <a href="http://www.microsoft.com/hardware/en-us/webcams" target="_hplink">two built-in webcams</a> for snapping pictures or video chatting. The Surface's kickstand, however, angles the device at 22 degrees, pointing the front-facing camera up at the user's face. <a href="http://www.microsoft.com/surface/en/us/about.aspx" target="_hplink">Microsoft set the rear-facing camera into the device at 22 degrees</a>, so that the user's not shooting down at the table when filming a subject.