The European parliament has backed Spain's peace process with Basque separatist group Eta, in a close vote.
Many Spaniards back the peace process but still do not trust Eta
After heated debate in the parliament, an attempt by conservatives to declare that Eta had not met pre-conditions for peace talks was only narrowly defeated.
MEP Martin Schulz said it was important to lend support to the Spanish government's attempts to find peace.
But opponents said the peace talks and the debate only served to give publicity to "terrorists".
Hundreds of people demonstrated outside the European Union's offices in Madrid on Tuesday, protesting against the debate.
The march was organised by the Association for the Victims of Terrorism, with support from the main opposition conservative Popular Party.
His resolution, which supported the peace dialogue launched by Spanish Prime Minister Jose Luis Rodriguez Zapatero, was approved by 321 votes to 311.
An opposing resolution by the conservative grouping, the European People's Party (EPP), arguing that Spain should maintain its anti-terrorist policies, was defeated by 322 votes to 302.
"The road towards dialogue is the only way we can bring an end to this spiral of violence," said Mr Schulz, a German.
Mr Schulz's motion was given strong support by the European Commission.
EU Justice Commissioner Franco Frattini urged deputies to back it, saying Spain's "tenacity and conviction in combating terrorism from the respect of democracy and the rule of law has paid off".
MEPs were split on the Spanish peace process
The debate demonstrated the strong differences between Spain's main political parties over how to deal with the conflict in the Basque region, says the BBC's Danny Wood in Spain.
The Spanish government said the vote was all about showing European solidarity against terrorism.
But many Spaniards are sceptical about Eta's permanent ceasefire, which was called in March, our correspondent says.
Several members of the European Parliament raised concerns about the alleged theft by Eta of more than 300 revolvers in France this week, saying it called the ceasefire into question.
EPP leader Hans-Gert Poettering asked how Eta could be trusted when it had not apologised to relatives of the more than 800 killed since it took up arms in 1968.
"As long as this doesn't happen we may expect they will kill once again," he said.
Eta remains on the EU's list of illegal terrorist groups.