Chief Executive Satya Nadella has focused on cloud services and mobile applications on slower growth in its traditional software business. Companies moving much of their information technology off premises, part of the cloud-computing trend, proved a bright spot.

"The enterprise cloud opportunity is massive, larger than any market we have ever participated in," Nadella said in a conference call.

Redmond, Wash.-based Microsoft's stock had climbed more than 26 percent in the past 12 months to $52.06 at Thursday's close, even as the broader market has dropped 5 percent. The shares rose 3 percent in after-hours trading.

Revenue from the "intelligent cloud" business, which includes products such as its Azure cloud infrastructure and services business along with other noncloud products such as traditional servers, rose 5 percent to $6.3 billion.

Perhaps a better measure of its cloud strength is what the company calls its combined cloud business, on track for $9.4 billion in annual revenue, the company said. That is up 15 percent from the $8.2 billion revenue it estimated last quarter.

"They nailed the cloud," said Matt Howard, a venture capitalist at Norwest Ventures who monitors Microsoft closely.

Total revenue, however, fell 10.1 percent to $23.80 billion, squeezed by a strong dollar as well as a weak personal computer market that has reduced demand for Microsoft's Windows operating system. On an adjusted basis, revenue fell to $25.69 billion but beat analysts' estimates.

Microsoft generates more than half of its revenue from outside the United States.

Revenue in the business that includes Windows fell 5 percent to $12.66 billion. Windows revenue closely tracks sales of personal computers, which fell 10.6 percent globally in the December quarter from a year earlier, according to research firm IDC.

IDC said business should improve later this year as companies that had delayed replacing machines before upgrading to Windows 10 make the switch. Microsoft released Windows 10 in July.

Microsoft's net income fell to $5 billion, or 62 cents per share, in its second-quarter ended Dec. 31 from $5.86 billion, or 71 cents per share, a year earlier. (http://bit.ly/1PIRXEs)

Excluding items, the company earned 78 cents per share.

Analysts on average had expected a profit of 71 cents per share and revenue of $25.26 billion, according to Thomson Reuters I/B/E/S.

(Reporting by Abhirup Roy in Bengaluru and Sarah McBride in San Francisco; Editing by Ted Kerr, Bernard Orr)