Claudia Cruz/CNET

Microsoft is hurting after shifting its smartphone strategy -- leading it to report the biggest quarterly loss in company history.

The company reported fourth-quarter earnings Tuesday that reflected a $7.5 billion writedown related to its failed acquisition of Nokia's phone and services business. Microsoft also said it will incur additional charges, for combined writedown costs of $8.4 billion.

Those charges contributed to a net loss of $3.2 billion, or 40 cents a share. Shares fell about 3.5 percent in after-hours trading, indicating investors had factored in the loss.

Microsoft paid $9.5 billion in April last year for Nokia's handset business, including the $1.5 billion in cash Nokia had on hand.

It's just the latest in a series of expensive after-effects of the software maker's ambitious plan to compete against Apple and Google in the mobile arena. Microsoft plans to lay off about 7,800 people, mostly from the Nokia division. Last year it laid off 18,000 employees -- its largest workforce reduction ever -- including 12,500 former Nokia employees.

The world's largest software company also reported sales of $22.2 billion for the three months ended June 30. Excluding writedown charges and other costs, Microsoft said it had a profit of 62 cents a share. That beats the estimate of 58 cents a share of analysts surveyed by Bloomberg.

Microsoft, under the stewardship of CEO Satya Nadella, has spent the past 18 months transforming its products and its approach to customers. The company is transitioning away from selling licensed software at flat (and high) prices and now offers subscriptions to its cloud-based apps and services. While that move shows up as lower sales for the quarter, the company actually makes more money over time.

In the process, though, the Redmond, Washington, company has had to make tough decisions about its strengths. Mobile hardware, it would seem, will not be one of them for the foreseeable future.

For now, the company is placing its biggest bet on the next version of its Windows operating system, which powers more than 90 percent of the world's computers. With Windows 10, out next week, developers will be able to write "universal" apps once, which can then run on any phone, tablet or PC running the new operating system.

Microsoft

Such universality will be key for Microsoft, which has failed to gain traction in the mobile market. The company's Windows Phone software runs on only 2.7 percent of the world's smartphone devices. It doesn't help that shipments of PCs, where Microsoft still dominates, were mostly flat in 2014, according to research firm Gartner. Smartphone shipments, on the other hand, rose 28 percent in the same period and sales of those devices now outnumber PCs roughly four to one.

Microsoft isn't out of the smartphone game. "I am committed to our first-party devices, including phones," Nadella said in a statement earlier this month when announcing the Nokia writedown and layoffs. "However, we need to focus our phone efforts in the near term while driving reinvention. We are moving from a strategy to grow a standalone phone business to a strategy to grow and create a vibrant Windows ecosystem that includes our first-party device family."

The company said it plans to still focus on business customers and low-end handsets while also offering longtime Windows fans a so-called flagship device -- equivalent to Apple's iPhone 6 or Samsung's Galaxy S6. In the meantime, Microsoft has to convince developers to write more apps for the Windows Phone platform.

Despite Microsoft's floundering smartphone efforts, sales of its Surface line of devices, which can be used as both a laptop and a tablet, more than doubled to $888 million for the quarter.

And Microsoft's bread and butter -- offering software, including Office, Windows and its Azure cloud platform to businesses -- is still growing steadily, despite Microsoft's move to the subscription sales model. Earlier this week, for example, it announced a deal to provide Office 365 subscriptions to General Electric and its 300,000 global employees. Microsoft also makes about half its Windows revenue from licensing the operating system to manufacturers like Acer and Lenovo, which sell new PCs to consumers.

Microsoft's older products fared the worse in the fourth quarter. Sales of Windows licenses to device makers fell $683 million, or 22 percent, while sales of Office products and Windows licensing to businesses each sustained single-digit losses.

The company's commercial cloud business -- which includes Office 365, Azure and software for helping businesses manage their data in the cloud -- grew 88 percent from the same period a year ago. Microsoft said the division is now on track to pull in more than $8 billion in annual sales.

Nadella previously has said he wants the cloud division, which he oversaw before becoming chief executive, to be a $20 billion-a-year business by 2018.