The measure, championed by the centre-right government of Prime Minister Mariano Rajoy, grants dual citizenship rights for Sephardic Jews, those descended from Jews expelled from Spain in 1492.
"This law says much about who we were in the past and who we are today and what we want to be in the future, an open, diverse and tolerant Spain," said Justice Minister Rafael Catala in parliament.
The Spanish Inquisition beginning in 1478 under Queen Isabella and King Ferdinand brought about widespread expulsions, executions and forced conversions of thousands of Muslim and Jewish people as a method of asserting the dominance of Catholics.
The Alhambra Decree in 1492 said that Jewish people faced death without trial if they did not leave Spain or convert to Christianity.
In 1924, a law gave the government discretionary powers to award Sephardic Jews nationality, but candidates had to give up their previous citizenship and they had to be residents of Spain.
The new law gives Sephardic Jews the same dual citizenship privilege Spain currently grants only to people from its former colonies and neighbouring Portugal and Andorra.
The bill -- which was introduced last year and which the government said was an effort to right a "historical mistake" -- has the support of all major parties and passed the final reading in the lower house of parliament by a wide margin.
"This is a historic day, an important day, an emotional day," the president of the Spanish Federation of Jewish Communities, Isaac Querub, told journalists on the steps of parliament ahead of the vote.
"It is a day of hope, a day of joy and we hope that this will make Spain a better place," added Querub, whose ancestors took refuge in North Africa after they were expelled from Spain.
The Spanish government estimates that about 90,000 people will apply for citizenship, although officials admit there is no precise way of knowing how many descendants meet the criteria.
Applicants do not have to be practising Jews, but they must have their Jewish heritage vetted by the Spanish Federation of Jewish Communities or by rabbis where they live.
They will also have to pass tests on Spanish language culture, prove they have a "special connection" to Spain and travel to the country at their own expense to apply.
The law will come into effect in October and will expire after three years although it could be extended by another year if deemed necessary.
While Jewish groups have welcomed the move, some Jewish leaders have complained that the requirements are too burdensome.
Leon Amiras, who heads an association of immigrants to Israel from Latin countries, said the length of the process and costs involved will deter most Sephardic Jews from applying.
"They will have to go through a Via Crucis, a bureaucratic hell, they will say they don't want it. I am disappointed with the law," he told AFP.
Gabriel Elorriaga, a senior lawmaker for the ruling Popular party who is responsible for shepherding the law through parliament, said the government had sought a "difficult balance" with the law between the need for checks and the desire to make is straightforward to apply.
"Granting citizenship to someone is a very solemn act in any state, you can't give citizenship just like that to someone," he said last month when asked about the complaints.
Kelly Benoudis Basilio, 70, a retired French literature professor who lives in Lisbon, said she was "very interested" in applying for Spanish citizenship even though she has no plans to live in Spain.
"For emotional reasons it is very important," said Basilio, a descendant of Jews expelled from Spain who was born in Ksar el-Kebir in northwestern Morocco and has Portuguese citizenship through marriage.
Though estimates vary, historians believe at least 200,000 Jews lived in Spain before the Catholic monarchs Isabella and Ferdinand ordered them to convert to the Catholic faith or leave the country.
Many who refused were burnt at the stake.
Up to 3.5 million people around the world are thought to have Sephardic -- Hebrew for "Spanish" -- Jewish ancestry.
The citizenship law is the latest step in Spain's modern efforts to atone for its past harsh treatment of Jews.
One major step was a visit to a Madrid synagogue in 1992 by Spain's former King Juan Carlos to recognise "injustices of the past."