JERUSALEM — The Spanish parliament formally approved on Thursday a law aiming to correct a “tragic and historic” error by offering citizenship to Jews whose ancestors were expelled from the country in 1492. Yes, 523 years later, it seems, Madrid wants to do the right thing.

“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,” Justice Minister Rafael Catalá told reporters outside the parliament building.

The legislation, which passed with a wide majority and with support from all the largest parties, is a rare gesture out of Europe, where anti-Semitism and other ethnic tensions have been on the rise in recent years. It was first proposed as the Sephardic Ancestry Bill in 2012, igniting self reflection and dragging up painful memories among the global community of Sephardic Jews.

Sephard is the name for Spain in Hebrew, and after the Jews were expelled from the Iberian Peninsula along with the former Muslim rulers there, they spread far and wide in North Africa, through the Ottoman Empire and beyond. Estimates of their numbers around the world number as high as 3.5 million. In Turkey, for generation after generation, they continued to speak Ladino, a variation of Spanish, and a few still do. But with the creation of Israel in 1948 and the Arab nationalist backlash in many countries where Sephardic Jews previously felt fairly secure, many moved to Israel, while others went to Europe and the Americas—and even back to Spain, where the Sephardic population is now estimated at 40,000.

The Spanish government expects that with the new law around 90,000 more will apply for Spanish citizenship, although it is not certain how many will actually meet the requirements. Among the applicants are thousands of Israelis who have bombarded immigration lawyers and the Spanish embassy in Tel Aviv with requests over the past few years.

While many older Israelis are seeking citizenship as a matter of pride, says Adam Yadid, an Israeli lawyer advising Sephardi-Israelis on the application process, many from the entrepreneurial, younger generations hope to use the opportunity as a means of gaining access to the European Union. A Spanish passport would give them freedom to work anywhere in the European Union, and to travel freely throughout most of the continent.

“The real test will be how this law is carried out,” says Leon Amiras, a lawyer who heads an association of immigrants to Israel from Spain, Portugal and Latin America. Amiras is originally from Argentina, where he grew up speaking Ladino, and until today he continues to read Ladino-language newspapers, delivered to his home in Israel from Turkey. He and his children will take out the Spanish passport in order to strengthen and pay tribute to their historic ties to Spain, he says.

In 1492 Roman Catholic King Ferdinand and Queen Isabella, having taken the last Muslim stronghold at Granada, issued the Alhambra Decree, which ordered Jews to convert to Catholicism or face death, in many instances by being burned at the stake in the ongoing horror show of the Inquisition. During this brutal period of expulsions, executions and forced conversions, Amiras’ family moved from Catalonia to what was then the Ottoman controlled city of Salonica, now Thessaloniki, Greece, and then to Izmir, Turkey, where they lived for many generations before finally emigrating to Argentina.

“During the time of the Inquisition the Ottoman emperor said, ‘What a stupid man, that Spanish king, now my empire will become the strongest in the world,’” says Amiras, explaining that the influx of Jewish doctors, merchants and intellectuals proved an economic boon for the Divine Port

That lesson has not been forgotten. While the Spanish government asserts that the move is about making amends, critics point to Spain’s economic interests in encouraging Jews to return. In addition to the Ottoman Empire, history has witnessed a number of economic upturns that came as a result of the transplant of Jewish communities, including in Argentina, Mexico and even Egypt.

Today, Spain’s unemployment rate hovers at a staggering 23 percent, with almost double that for workers under 25, according to a report by the International Monetary Fund released this month.

Spain’s current willingness to minimize bureaucratic hurdles—including a Spanish language test and the requirements for applicants to travel to Spain at their own expense—will make the law “either historic or meaningless,” says Amiras.

Other stipulations which may prove problematic including requiring Sephardic Jews to prove a link to the country— impossible for the many families who in the chaos of exile and with the passing of years have lost much of their documentation. A lot of documents can get lost in 500 years.

The application process is set to start officially in October, and will be valid for three years only, with a possible fourth year extension—a condition that lawyers familiar with the Sephardic Jewish community say may not be enough time to gather the appropriate paperwork.

In contrast to an earlier law of return in effect since 1924, which obliged applicants to give up citizenship to their country of birth and to live as residents in Spain, the new law does present improvements by providing dual citizenship privileges.

Eran Cabaliero, a 37-year-old Israeli owner of a start-up, says that he will apply for Spanish citizenship, and would like to some day take advantage of the economic opportunities in the 28-country European Union.

“It’s about coming full circle,” says Cabaliero, who reverted to his Spanish surname after his grandparents had Hebrew-ized it. “But of course I’m thinking about my future and the future for my children, and joining the E.U. would certainly open a lot of doors.”

Like many Israelis, he is not planning on relocating to Spain immediately, but is glad to know that he will have the option, especially at a time when many young middle-class Israelis are struggling financially and are increasingly fatigued by the country’s endless wars.

Cabaliero recently met his Spanish relatives in what he describes as an emotional encounter in Barcelona, which made him realize the richness of his family history, with its many rabbis, doctors, and leaders in the community.

“Continuing this tradition is important for my grandparents, but one of the reasons that I will apply will be so that we can keep the history alive for my children,” he says.