Spanish lawmakers have overwhelmingly adopted a motion calling on the government to recognise a Palestinian state, following similar moves in other European nations.
The vote on Tuesday night was 319 in favour with two opposed and one abstention.
The motion submitted by the opposition Socialists asks the conservative government to recognise Palestine in coordination with any similar move by the European Union.
The symbolic motion, which echoes similar votes last month in Britain and Ireland, was backed by all the political groupings in the lower house after the ruling People's Party (PP) watered down the wording.
The non-binding text brought by the Socialists was initially an outright call to recognise a Palestinian state and had angered the Israeli government.
But Beatriz Rodriguez-Salmones of the PP, which holds an absolute majority in the lower house, told the debate her party would not back a unilateral recognition of the Palestinian state "at a time of intense pain for Israel".
"It is not the right time to seek a unilateral recognition. Peace and a peaceful cohabitation between two states are the objective ... The method is a negotiation between the two," she said.
The text that was adopted said: "The parliament urges the government to recognise Palestine as a state ... This recognition should be the consequence of a process negotiated between the parties that guarantees peace and security for both, the respect of the rights of the citizens and regional stability."
Foreign Minister Jose Manuel Garcia-Margallo, the only member of the Spanish government to attend the debate, said the government was now committed to working in favour of a dialogue between the two parties that brought "peace, stability and progress to a region that has been suffering for a long time".
He also called on the European Union to have a coordinated approach on the issue.
France is eyeing its own non-binding resolution this month after Sweden's centre-left government took the lead by officially recognising the state of Palestine within days of taking office last month.
The moves reflect mounting frustration in the EU at Israel's expanding settlement programme on land the Palestinians want for a state following the collapse of US-sponsored peace talks.
The EU's new foreign policy chief, Federica Mogherini, said the bloc's 28 foreign ministers discussed on Monday how they could start "a positive process with the Israelis and Palestinians to relaunch a peace process".