Microsoft has made the first quarterly loss in its history after it wrote off some of the value of its online advertising business.
The loss came after it wrote down the value of Aquantive by $6.2 billion (5 billion Euros), which failed to bring the profits expected by Microsoft.
That led to a $492 million loss in the three months to the end of June, compared with a profit of $5.9 billion a year ago.
The computing giant company has not made a loss since it joined the stock market in 1986.
It took over Aquantive in 2007 but it struggled to compete with rival Google.
Microsoft paid $6.3 billion for Aquantive.
Microsoft is doing well in other areas, despite the decline in popularity of its Windows operating system, which dominated the personal computer market for years.
Revenue for the three months to June rose by 4% to $18.06 billion.
Excluding the adjustment for the asset write-down, and the holding back of some income related to the launch of its Windows 8 system, Microsoft profits beat those expected by investors.
Shares were up 1.6% after the results were announced.
Microsoft says the update of the Windows systems is the most important redesign in more than 10 years.
Windows 8, which will launch in October, will feature a new look that will present applications in a mosaic of tiles.
Importantly, it will also enable the operating system to work on tablet computers, which along with smartphones are the fastest-growing sector of the computing market.
Microsoft is also planning to release its own tablet, the Surface.
Earlier this week, Microsoft previewed its next version of the Office system, which is expected to be released next year.