Facebook said its computer system was "targeted in a sophisticated attack" last month, but that it found no evidence any user data was compromised.
The company said in a blog post on Friday that malware came from an infected website of a mobile developer and that "we remediated all infected machines, informed law enforcement, and began a significant investigation that continues to this day."
The attackers used a previously unseen exploit taking advantage of a flaw in Java software made by Oracle, which was alerted to the situation and released a patch the first of February, according to Facebook.
The hackers appeared to be targeting developers and technology firms based on the website they chose to booby-trap with malicious code.
"Facebook was not alone in this attack," the Northern California-based company said.
"It is clear that others were attacked and infiltrated recently as well."
The US intelligence community has concluded that America is the target of a massive cyber-espionage campaign that is threatening its competitiveness, The Washington Post reported just days ago.
Citing unnamed officials, the newspaper said the conclusion is contained in the National Intelligence Estimate, a classified report that represents the consensus view of the US intelligence community.
The document, according to the Post, identifies energy, finance, information technology, aerospace and automotive companies as the most frequent targets of hacking campaigns that appear state sponsored.
Early this month Twitter said it was hammered by a cyber attack similar to those that recently hit major Western news outlets, and that the passwords of about 250,000 users were stolen.
The attack coincided with the revelation of several high-profile security breaches. The New York Times and The Wall Street Journal said that they had been hacked, and pointed to attackers from China.
It was unknown whether the cyberattack on San Francisco-based Twitter was related to high-powered hacker assaults on Facebook, the Times or the Journal.