The historic move paves the way for the government to bring an end to more than 30 years of bloody attacks waged by the Euskadi ta Askatasuna (Basque Homeland and Freedom) group.
The main opposition Popular Party stood alone in opposing the resolution backed by the ruling Socialists.
The resolution was passed with 192 lawmakers in favour, and 147 Popular Party MPs against.
The carefully worded document stressed the need for ‘dialogue’, rather than ‘negotiation’, saying violence was “totally incompatible with democracy” and in no way condoned by the parliament.
“If appropriate conditions to end the violence through dialogue – based on a clear determination to end it and on unequivocal attitudes likely to produce it – emerge, we back a process of dialogue between the competent state institutions and those who decide to abandon violence,” the resolution read.
Popular Party MP Eduardo Zaplana denounced the action.
“When terrorists are invited to dialogue and negotiations, the first thing they think is that their crimes and murders were worth it,” Mr Zaplana said.
But Socialist Dego Lopez Garrido hit back, accusing the Popular Party of ‘bad faith’, saying that previous Socialist and Popular Party governments had tried talks with ETA in 1989 and 1999.
Both times discussions fell through and attacks resumed in early 2000 after a 14-month truce.
The head of an association representing victims of ETA expressed his outrage at the latest effort.
“To reach an agreement with ETA is to humiliate the living and the dead,” Francisco Alcaraz said.
“There is no way that the deaths which ETA has caused in this country can be legitimised,” Mr Alcaraz added, saying that Prime Minister Jose Luis Rodriguez Zapatero had betrayed victims.
According to a survey published by El Pais newspaper, almost two-thirds of Spaniards support the opening of talks if ETA agrees to renounce violence.
ETA has been fighting for a separate Basque homeland in northern Spain and south-western France since the late 1960s and has been blamed for more than 800 deaths.