By Aaron Tilley

Microsoft Corp. reported strong growth in quarterly sales driven by sustained strength in its cloud-computing segment that benefited from customers shifting more work online during the coronavirus pandemic.

The software giant on Wednesday said sales rose 13% in its fiscal fourth quarter to $38 billion, and that it generated a net profit of $11.2 billion. Both measures for the June-ended period topped Wall Street expectations.

Sales for Azure, Microsoft's closely watched cloud-computing service, grew 47% from a year earlier. The revenue growth rate was 64% in the fourth quarter a year earlier and 59% in Microsoft's third quarter.

"The last five months have made it clear that tech intensity is the key to business resilience. Organizations that build their own digital capability will recover faster and emerge from this crisis stronger," said Microsoft chief Satya Nadella in a statement.

Shares in Microsoft fell more than 2% in after-hours trading. Microsoft shares have gained about 34% so far this year, compared with a 5% decline in the Dow Jones Industrial Average.

The broader intelligent-cloud segment, which includes Azure, booked revenue of $13.37 billion, up 17% from a year earlier. The company's productivity and business process division, which includes LinkedIn, sales-management software Dynamics and commercial subscriptions to the Office 365 product suite, generated $11.75 billion in revenue, up 6%.

Wall Street was hoping to see better performance on margins, Azure and the productivity business, said Jefferies analyst Brent Thill. "You saw a surge in demand but that demand is starting to level off a bit," Mr. Thill said about Microsoft's initial surge in cloud business during the pandemic.

Microsoft's personal computing business -- which includes licensing revenue from PC sales, the Xbox gaming platform and Surface laptops -- saw sales advance 14% to $12.91 billion. The company's gaming content business drove most of that growth with a 65% jump in sales over the previous year.

Even as the pandemic has fueled appetite for Microsoft products -- including demand for its Teams workplace collaboration software suite -- it also has forced the tech behemoth to adapt. The Redmond, Wash.-based company was early to shift most employees to remote working when Covid-19 cases spread across the U.S. More recently, Microsoft said it would exit its more than 80 bricks-and-mortar retail stores.

Even though Teams has been a big success for Microsoft during the pandemic, the product has drawn scrutiny from competitors. Earlier Wednesday, business chat software rival Slack Technologies Inc. filed a complaint with the European Union's competition regulator that Microsoft unfairly bundled Teams free with its suite of business productivity apps, Office 365. Slack is asking the European regulator to force Microsoft to sell Teams as a stand-alone product. In response, Microsoft said it is committed to providing customers a variety of choices and that it looks forward to providing additional information to the regulator.

The wider economic impact of the coronavirus outbreak also has impacted the company. Microsoft in April said it saw a slowdown in finalizing some licenses, particularly involving smaller and medium-size businesses, many of which have been hit hard by the recession.

in the final weeks of the prior quarter Microsoft also shifted policies in the face of the public outcry about police brutality and racial inequality sparked by the killing of George Floyd, a Black man, in police custody. It suspended the sale of facial-recognition technology to U.S. police until there is a national law regulating its use.

Microsoft's LinkedIn business, which it acquired for more than $26 billion in 2016, has been hurt during the pandemic by weakened demand for its recruitment services and soft advertising spending. Though LinkedIn revenue grew 10% in the most recent quarter, the company said earlier in the week it would cut about 960 jobs, or around 6% of its workforce.

Write to Aaron Tilley at aaron.tilley@wsj.com