Microsoft last night reported revenue and profit above Wall Street expectations, as sales of its hardware and cloud-computing services helped to offset a decline in the company's core Windows business. 

Sales of Windows to computer manufacturers to install on new PCs fell 19% in the quarter.

This reflected a sharp dip from a year ago when Windows got a brief boost from consumers rushing to buy new machines after Microsoft stopped support for the 14-year-old XP operating system. 

But that decline was offset by higher revenue from its Surface tablet, back-end server software and cloud-related offerings such as its online Office 365 suite of applications. 

The company said its commercial cloud-related revenue for the quarter more than doubled, and was now running at $6.3 billion a year. also said its quarterly cloud revenue rose almost 50% to $1.57 billion, suggesting a similar annual number. 

Microsoft's overall revenue rose 6% to $21.7 billion, above Wall Street's average forecast of $21.1 billion, according to Thomson Reuters I/B/E/S. 

Taking out the effects of the strong US dollar on currency rates, Microsoft said revenue would have risen 9%. 

Earnings per share declined to 61 cents per share from 68 cents in the year-ago quarter. Analysts had expected 51 cents, on average.

Analysts said that Wall Street will welcome the results as it appears Microsoft is back on the right track after a "head-scratching performance" last quarter.