EU states agreed today on tight laws against incitement to terrorism in order to clamp down on militant groups' use of the Internet.
EU justice and interior ministers also agreed in Luxembourg on an action plan to try to stop groups getting explosives.
Police say the Internet has taken on huge importance for militants, enabling them to share knowledge, plan operations and spread propaganda to a mass audience.
"The internet is used to inspire and mobilise local terrorists...functioning as a virtual training camp," a text agreed by ministers said.
"Each member state shall take the necessary measures to ensure that terrorist-linked offences include ... public provocation to commit a terrorist offence, recruitment for terrorism, training for terrorism."
States may also consider attempts to train and recruit as terrorist offences, but are not obliged to do so, an EU official said.
Spain's secretary of state for justice, Julio Perez Hernandez, welcomed the move.
"The battle to anticipate [terrorist acts] is crucial for Spain," he told reporters. "One should not wait for smoke to know there is terrorism."
In an effort to assuage civil rights campaigners, the law says that the new measure may not be used to restrict freedom of expression and freedom of the press.