Facebook said it was working with Kaspersky Lab, bolstering a program implemented with other online security firms including ESET, F-Secure and Trend Micro.
"Thanks to the collaboration with these companies, in the past three months we have helped clean up more than two million people's computers that we detected were infected with malware when they connected to Facebook," said Trevor Pottinger, a Facebook security engineer.
"In these cases, we present a cleanup tool that runs in the background while you continue using Facebook, and you get a notification when the scan is done to show you what it found."
Kaspersky Lab's Kate Kochetkova said in a separate blog post that Facebook users are often targeted in online fraud schemes such as "phishing," which are faked emails designed to get recipients to download malware.
"Facebook is a major aim for phishers: one in five phishing scams targets Facebook notifications. So be vigilant when you receive emails appearing to be from Facebook: as they can be fake. There are lots of Trojans targeting Facebook users as well," she said.