The US-based firms have agreed to speed up their reactions when illegal material is flagged up, with the aim of looking at all suspicious material within 24 hours.
"The recent terror attacks have reminded us of the urgent need to address illegal online hate speech," EU Justice Commissioner Vera Jourova said in a statement, referring to attacks in Paris and Brussels claimed by the Islamic State jihadist group.
"I welcome the commitment of worldwide IT companies to review the majority of valid notifications for removal of illegal hate speech in less than 24 hours and remove or disable access to such content, if necessary."
The US firms insisted that following the EU rules would not compromise freedom of speech.
Also Read
"We remain committed to letting the Tweets flow. However, there is a clear distinction between freedom of expression and conduct that incites violence and hate," said Twitter's Head of Public Policy for Europe, Karen White.
Monika Bickert, Head of Global Policy Management at Facebook, said they "welcome today's announcement and the chance to continue our work with the Commission and wider tech industry to fight hate speech."