The ruling Popular Party and the main opposition Socialists were in talks on the final wording of the motion which has the support of the government, sources from the two parties said.
The vote came as two Palestinians armed with a gun and meat cleavers burst into a Jerusalem synagogue and killed four Israelis in the bloodiest attack in the city in years.
The motion, proposed by the Socialists, calls on the Spanish government to "recognise Palestine as a state", according to a draft text presented by the Socialists which can still be amended.
It also urges Prime Minister Mariano Rajoy "to promote in coordination with the European Union the recognition of the Palestinian state as sovereign, contiguous, democratic and independent which lives in peace and security with the state of Israel."
"It is not binding, it does not set a timeline for the recognition, it gives the government the margin to proceed with the recognition when it feels it will be opportune," Spanish Foreign Minister Jose Manuel Garcia-Margallo told reporters in Brussels on Monday.
"If we want to be effective this recognition must be done in coordination with the European Union," he added.
The motion follows moves in other European countries intended to increase pressure for a two-state solution to the Israeli-Palestinian conflict.
Britain and Ireland approved similar non-binding motions last month that call on their governments to recognise Palestine. Neither government has heeded that call.
Signup to our newsletter and follow us on Facebook and Twitter!
French lawmakers will vote on November 28 on a proposal by the ruling Socialist party urging the government to recognise Palestine as a state.
Sweden's new left-leaning government went a step further and officially recognised a Palestinian state on October 30, prompting a strong protest from Israel, which swiftly withdrew its ambassador from Stockholm.
The efforts in Europe reflect growing international impatience with Israel's nearly half-century control of the West Bank, east Jerusalem and its blockade of the Gaza Strip.
Criticism has become more focused in the wake of this summer's 50-day offensive by the Israeli army in Gaza that killed more than 2,000 Palestinians and dozens of Israelis.
The Palestinian Authority estimates that 134 countries have now recognised Palestine as a state, although the number is disputed and several recognitions by what are now European Union member states date back to the Soviet era.
An AFP count puts the number of states that recognise Palestine at 112.
The Spanish motion was first proposed last month by Socialist lawmaker Trinidad Jimenez, a former foreign minister who sits on parliament's foreign affairs committee.
Rajoy sent a telegram to Israeli Prime Minister Benjamin Netanyahu expressing his "energetic condemnation of the vile terrorist attack" carried out at the synagogue in Jerusalem.