Microsoft Corp on Wednesday said it will lay off 10,000 employees — about 5% of its workforce — by the end of the third fiscal quarter of 2023.

The US-based tech giant is looking to cut costs amid the looming threat of a global recession.

In an email to employees, Microsoft chief executive Satya Nadella said the company will align its cost structure with revenue and where it sees customer demand. "We saw customers accelerate their digital spend during the pandemic, we're now seeing them optimize their digital spend to do more with less," he said.

"Today, we are making changes that will result in the reduction of our overall workforce by 10,000 jobs through the end of FY23 Q3. This represents less than 5 percent of our total employee base, with some notifications happening today. It's important to note that while we are eliminating roles in some areas, we will continue to hire in key strategic areas. We know this is a challenging time for each person impacted. The senior leadership team and I are committed that as we go through this process, we will do so in the most thoughtful and transparent way possible," the Microsoft CEO wrote.

The layoffs will result in a charge of $1.2 billion in the second quarter of fiscal 2023. "We are taking a $1.2B charge in Q2 related to severance costs, changes to our hardware portfolio, and the cost of lease consolidation as we create higher density across our workspaces," Nadella said.

He, however, added that the company will continue to invest in strategic areas. "We are allocating both our capital and talent to areas of secular growth and long-term competitiveness for the company, while divesting in other areas."

On layoffs, Nadella said these decisions are difficult, but necessary. "These are the kinds of hard choices we have made throughout our 47-year history to remain a consequential company in this industry that is unforgiving to anyone who doesn't adapt to platform shifts," he added.

U.S.-benefit-eligible employees will receive a variety of benefits, including above-market severance pay, continuing healthcare coverage for six months, continued vesting of stock awards for six months, career transition services, and 60 days' notice prior to termination, regardless of whether such notice is legally required, the company said.

Benefits for employees outside the U.S. will align with the employment laws in each country, it added.

Follow us on Facebook, X, YouTube, Instagram and WhatsApp to never miss an update from Fortune India. To buy a copy, visit Amazon.