Microsoft joined Facebook and Apple on the list of American technology companies targeted in recent cyber attacks.
"As reported by Facebook and Apple, Microsoft can confirm that we also recently experienced a similar security intrusion," Trustworthy Computing team general manager Matt Thomlinson said in a blog post, according to AFP.
"During our investigation, we found a small number of computers, including some in our Mac business unit, that were infected by malicious software using techniques similar to those documented by other organizations."
There was no evidence that customer data was stolen but an investigation into the attack was continuing, according to Thomlinson.
"This type of cyberattack is no surprise to Microsoft and other companies that must grapple with determined and persistent adversaries," he said.
Apple said Tuesday that hackers invaded its system in an attack similar to one recently carried out against Facebook, but that it repelled the intruders before they gained access to confidential information.
The maker of iPhones, iPads, iPods and Macintosh computers said it was working with law enforcement officials to hunt down the hackers, who appeared tied to a series of recent cyber attacks on US technology firms.
"The malware was employed in an attack against Apple and other companies, and was spread through a website for software developers," Apple told AFP.
The malicious software, or malware, took advantage of a vulnerability in a Java program used as a "plug-in" for Web-browsing programs.
A "small number" of computer systems at Apple were infected but they were isolated from the main network, according the Silicon Valley-based company.
"There is no evidence that any data left Apple," Apple said.
Word of hackers hitting Apple came just days after leading social network Facebook said it was "targeted in a sophisticated attack" last month, but that no user data was compromised.
Facebook said malware that infected some of its machines came from a mobile developer website that had been booby-trapped.
Early this month, Twitter said it was hit by a cyber attack similar to those that recently plagued major Western news outlets, including The New York Times and The Washington Post, and that the passwords of about 250,000 users were stolen.