Software maker Microsoft on Tuesday reported revenue and earnings well ahead of expectations, although the company took a big hit from a writedown of its Nokia phone unit acquisition.

For the three months ended June 30, Microsoft posted a net loss of $3.2 billion, or 40 cents per share, on revenue of $22.2 billion. Excluding the costs related to the Nokia writedown and other restructuring charges, Microsoft said it would have posted per-share earnings of 62 cents.

The company had been expected to post per-share earnings of 56 cents on revenue of $22.06 billion, according to Yahoo Finance.

“We finished the fiscal year with solid progress against our strategic priorities, through strong execution and financial discipline,” CFO Amy Hood said in a statement.

Nonetheless, Microsoft shares fell in after-hours trading. Shares changed hands recently at $45.65, down $1.63 or more than 3 percent.

Microsoft said it would wait until a 2:30 pm PT conference call to offer up its outlook for the current quarter.

The report follows the company’s announcement earlier this month that it would cut a further 7,800 jobs and take a $7.6 billion writedown on its purchase of Nokia’s phone business.

Microsoft said that its commercial revenue (aka sales to businesses) rose slightly to $13.5 billion, while consumer revenue from Office, Windows and Windows Phone all dropped from a year ago. Microsoft plans to release the PC version of Windows 10 next week, with updates to its phones and Office also due out later this year.

The company sold 8.4 million Lumia smartphones, up 10 percent from the prior year, but revenue fell as more of the devices sold this year were in the lower end of the market. Surface revenue more than doubled, to $888 million, while sales of 1.4 million Xbox consoles represented a 30 percent year-over-year increase.

In its online business, Microsoft said search revenue increased 21 percent, with Bing’s U.S. market share rising to 20.3 percent, up 1 percentage point from a year ago.

Here is Microsoft’s summary of its quarterly highlights:

Update, 2:35 p.m. PT: CEO Satya Nadella kicked off the conference call on an optimistic note, noting that the company has restructured itself to deliver better products at “a more rapid pace.”

He said that the company’s cloud-based services for business are on an $8 billion run rate and on track to reach his goal of $20 billion in such revenue by fiscal 2018.

2:40 p.m.: Lots of billion dollar opportunities out there, Nadella says, ranging from Azure cloud-based operating system to CRM to security.

2:41 p.m.: Nadella, on Windows 10: Our aspiration with Windows 10 is to change people “from needing to choosing to loving Windows,” repeating a line he used back in January.

“I do believe Windows 10 will broaden our opportunity and return Windows to growth,” Nadella said.

First Windows 10 PCs will be available on launch day, with widest-ever assortment on sale by the holidays. Phone losses will narrow, Nadella said, with the new focus (less models, fewer markets).

“We’re confident these are the right levers to revitalize Windows and restore growth,” Nadella said, pointing to Surface tablet as an example where the company has turned things around. “Surface is clearly a product where we have gotten the formula right.”

2:46 p.m.: Bada-bing.

“Bing will transition to profitability in the coming fiscal year,” Nadella said.

2:53 p.m.: CFO Amy Hood noted that the company’s bookings were flat from the prior year, but that the company reached a milestone in another key measure of future sales. The company’s level of sales to businesses that are “contracted but not billed” hit an all-time high of $24.5 billion.

2:56 p.m.: On to 2016 guidance.

The company is deferring a portion of the Windows 10 revenue and recognizing it over a period of two-to-four years but plans to give guidance excluding that impact.

Strengthening fo U.S. dollar should affect the company for the coming year, assuming a similar exchange rate, denting revenue by 5 percent.

The company expects, as Nadella noted, a profitable Bing.

Microsoft now sees operating expenses of $32.1 billion to $32.4 billion, below its April guidance, reflecting the cuts it has made in the phone business.

3:01 p.m.: For the first quarter, Microsoft sees revenue from consumer licensing to be $3.4 billion to 3.6 billion. Computing and gaming hardware revenue should be $2.0 to $2.1 billion. Phone hardware sales should be about $900 million, but with gross margins improving from the prior quarter due to the cost cuts being made.

Commercial revenue should be roughly flat due to the impact of currency.

3:02 p.m.: On to Q and A…

First question is on Office 365 subscription service, prompting Nadella to say “Overall we are very excited about the growth we are seeing in Office 365.” He added that consumer subscribers increasing by about 1 million per month and that, on the enterprise side, the growth “remains very exciting for us.”

3:08 p.m.: People still can’t agree how to pronounce Azure.

3:12 p.m.: Nadella says that he is excited for Windows 10, but says that financial impact will build over time. “My bullishness for Windows 10 is more in the second half of the fiscal year.” (Microsoft’s fiscal year runs from July to June.)

On the changes to the phone business, Nadella said the biggest shift “is not to think about phones in isolation.” Being a part of the phone business is important, Nadella said.

One area that remains important to Microsoft is flagship phones for Windows fans: “That’s actually a segment today (where) we don’t have good devices and we hope to change that with Windows 10.”

The company can also play in business phones and at the low-end of the smartphone market, but that last area is where the company needs to be more efficient, Nadella said. “That’s where you will see the most significant operational changes,” he said.

3:25 p.m.: A lot of talk about CRM and ERP and SaaS. OMG.