Microsoft says a small number of its computers, including some in its Mac software business unit, were infected with malware, but there was no evidence of customer data being affected and it is continuing its investigation.
The world's largest software company said the security intrusion was "similar" to recent ones reported by Apple and Facebook.
The incident, reported on one of the company's public blogs happened "recently", but Microsoft said it chose not to make any statement publicly while it gathered information about the attack.
"This type of cyberattack is no surprise to Microsoft and other companies that must grapple with determined and persistent adversaries," said Matt Thomlinson, general manager of Trustworthy Computing Security at Microsoft, in the company's blog post.
Over the past week or so, both Apple and Facebook said computers used by employees were attacked after visiting a software developer website infected with malicious software.
The attacks come at a time of broader concern about computer security.
Newspaper websites, including those of The New York Times, The Washington Post and The Wall Street Journal, have been infiltrated recently. Earlier this month US President Barack Obama issued an executive order seeking better protection of the country's critical infrastructure from cyber attacks.
Do you check your smartphone in bed?Related story: Smartphone etiquette - should you take it to bed?