(Reuters) - Microsoft Corp MSFT.O reported better-than-expected quarterly profit on Thursday as demand for its cloud computing services for companies rose and its personal computer software business stabilized.

FILE PHOTO: An promotional video plays behind a window reflecting a nearby building at the Microsoft office in Cambridge, Massachusetts, U.S. on May 15, 2017. REUTERS/Brian Snyder/File Photo

Shares of the world’s largest software company rose 3.1 percent to $81.20 in trading after the bell.

Microsoft’s focus on fast-growing cloud applications and platforms is helping it beat slowing demand for personal computers that has hurt sales of Windows - the software that powered the company to the top in the 1990s.

Under Chief Executive Satya Nadella, Microsoft’s cloud business - which includes products such as Office 365, Dynamic 365 and the flagship Azure computing platform - has emerged as a major source of growth.

Revenue from Microsoft’s intelligent cloud business rose nearly 14 percent to $6.92 billion in Microsoft’s fiscal first quarter, ended Sept. 30. Analysts on average had expected $6.70 billion, according to financial data and analytics firm FactSet.

Revenue from Azure, which competes with Amazon.com Inc's AMZN.O Amazon Web Services and offerings from Alphabet Inc's GOOGL.O Google, IBM IBM.N and Oracle Corp ORCL.N, grew 90 percent compared to a 97 percent growth rate in the preceding quarter.

Azure’s strong performance helped lift the gross margin at Microsoft’s cloud business to 57 percent, said Stephanie Rodriguez, director of investor relations for Microsoft.

Microsoft said its commercial cloud annualized revenue run rate reached $20.4 billion in the quarter. In 2015, Nadella set a target of $20 billion in cloud revenue by 2018.

In a call with analysts after earnings, Nadella said retailer Costco Wholesale Corp COST.O recently chose Azure its hybrid cloud platform.

Revenue from Microsoft’s personal computing division, its largest by revenue, fell 0.2 percent to $9.38 billion but handily beat analysts’ estimate of $8.81 billion.

The unit includes Windows software, Xbox gaming consoles, online search advertising and Surface personal computers.

After two straight quarters of declining Surface revenue, Microsoft notched a 12 percent year-over-year increase in revenue for its tablets and laptops in the latest quarter, helped by the release of a new Surface in May.

Microsoft also benefited from a 13 percent year-over-year increase in revenue from Dynamics, its enterprise and sales software business which competes with Salesforce.com Inc CRM.N.

“Even though best in class is Salesforce, Microsoft has a good enough product to get a large amount of business,” said Kim Forrest, an equity analyst at Fort Pitt Capital Group.

“Microsoft is set for an acceleration of growth and bookings with margin concerns that were overblown heading into 2018,” said Daniel Ives at research firm GBH Insights. “A slowly improving PC environment is also a modest tailwind for Microsoft with cloud remaining the Trojan horse growth driver for Redmond over the coming years.”

The technology company, based in Redmond, Washington, reported net income of $6.58 billion, or 84 cents per share, up from $5.67 billion, or 72 cents per share, a year earlier. (bit.ly/2lkGlyz)

Revenue rose 12 percent to $24.54 billion.

Microsoft's shares had risen nearly 27 percent this year through Thursday, eclipsing the 14.4 percent gain in the broader S&P 500 .SPX.