Four of the world's biggest tech companies are collaborating to crack down on terrorist content on their platforms.

Facebook (FB), Twitter (TWTR), Microsoft (MSFT) and Google's (GOOG) YouTube say they will set up a shared database to help them track and remove "violent terrorist imagery or terrorist recruitment videos."

The database will contain the digital "fingerprints" of the images and videos, allowing the tech firms to identify potential terrorist content more efficiently, the companies said in a statement Monday.

The internet giants have been battling the spread across the internet of content linked to terrorist organizations. Supporters of the Islamic militant group ISIS have proved particularly adept at using social media for propaganda and recruitment.

Related: Big tech firms are too slow to remove hate speech

Executives from top tech companies met with U.S. government officials in January to talk about how terrorists are using social media to recruit attackers. In August, Twitter said it had suspended hundreds of thousands of accounts for promoting terrorism.

Such suspensions have drawn angry reactions from some users, including threats by ISIS supporters against the founders of Twitter and Facebook.

The Obama administration said in July that Twitter traffic for ISIS has declined significantly over the previous two years.

The tech firms have the challenge of balancing freedom of expression with preventing illegal activity and respecting users' privacy. They also face the potentially contentious task of determining what constitutes terrorist content.

Related: Twitter suspends another 235,000 accounts for promoting terrorism

The announcement from the four companies on Monday came hours after they were singled out by European officials for not removing hate speech from their platforms fast enough. The European Commission found that only 40% of hate speech published on the firms' platforms was reviewed within 24 hours.

The tech firms will start the terrorist content database with the digital fingerprints of "the most extreme and egregious terrorist images and videos we have removed from our services," they said. Fingerprints for offending content found on one company's platform can be added so that the other participants can check if it's been posted on theirs as well.

More companies could become involved in the database in the future, the statement said.