The results beat analyst expectations and the company's shares rose $1.01, or 2.5 percent, to $40.87 in after-hours trading. They had closed up 17 cents at $39.86 in the regular session.
Net income in the quarter through March 31 came to $5.66 billion, or 68 cents per share, down from $6.06 billion, or 72 cents per share, in the same period a year ago.
Revenue was nearly unchanged at $20.40 billion, compared with $20.49 billion a year ago.
Analysts polled by FactSet expected Microsoft to post earnings of 63 cents per share on revenue of $20.39 billion.
Revenue from devices and consumer products rose 12 percent to $8.30 billion as the company sold more Xbox One game consoles and consumers upgraded systems from Windows XP, for which Microsoft ended support earlier this month.
Commercial revenue grew 7 percent to $12.23 billion, as revenue grew from its Office 365 productivity software. Azure revenue more than doubled.
Total revenue gains of $1.7 billion from various segments were offset by a $1.8 billion decline in upgrade offers revenue.