Microsoft reported a US$3.2 billion quarterly net loss, hurt by charges related to its Nokia phone business and job cuts, and weak demand for its Windows operating system.
The company took a charge of US$7.5 billion in the fourth quarter related to the restructuring of its Nokia handset business, which it acquired last year.
Microsoft's shares fell 3.5 percent to US$45.65 in extended trading on Tuesday US time.
Under chief executive Satya Nadella, the company has shifted its focus to software and cloud services as demand for its once-popular Windows operating system slows.
Sales of Windows to computer manufacturers to install on new PCs fell 22 percent in the quarter. The company is scheduled to roll out Windows 10 on 29 July, a much-awaited launch after a lacklustre response to Windows 8.
Revenue from its commercial cloud business, which includes offerings such as Office 365 and Azure, rose 96 percent, excluding the impact of a strong dollar.
Microsoft said this month that it would cut 7,800 jobs, or nearly 7 percent of its workforce, mainly in the phone hardware business.
The company reported a net loss of 40 cents per share for the quarter ended 30 June. Microsoft reported net income of US$4.61 billion, or 55 cents per share, a year earlier.
Microsoft recorded total impairment, integration and restructuring expenses of US$8.4 billion including the charges related to the Nokia phone business.
Excluding the charges, Microsoft earned 62 cents per share.
Revenue fell 5 percent to US$22.18 billion.
(Reporting by Devika Krishna Kumar in Bengaluru; Editing by Kirti Pandey)