The European Parliament voted 308 to 204 with 70 abstentions to back the proposal meant to solve the problem of internet hosting services being misused for terrorism.
The EU move comes in the wake of the killing of 50 Muslims at a mosque in Christchurch by an Australian white supremacist gunman on 15 March.
The shooter live-streamed his rampage on Facebook and it remained on the social media site for more than an hour. Numerous copies were uploaded to YouTube and linked off Twitter as well.
A new European Parliament is due to be elected between 23 and 26 May and it will finalise the text of the law along with the European Commission and members of EU governments.
“There is clearly a problem with terrorist material circulating unchecked on the Internet for too long,” said Daniel Dalton, rapporteur for the proposal.
“This propaganda can be linked to actual terrorist incidents and national authorities must be able to act decisively. Any new legislation must be practical and proportionate if we are to safeguard free speech.
“It ...absolutely cannot lead to a general monitoring of content by the back door.”