Growing numbers of Britons are taking official Spanish language exams in order to become citizens of Spain, motivated by fears about Brexit and a looming deadline for people with Sephardic Jewish ancestry.

Figures published by the Instituto Cervantes show a 21% increase since last year in the numbers taking Spanish as a foreign language diploma, which is a requirement for anyone wanting citizenship.

The institute, which is responsible for promoting Spanish language and culture around the world, says more than 400 people in the UK will take the exams this year, compared with 227 in 2015. “Certainly this is related to Brexit and the desire to keep a European passport,” Ignacio Peyró Jiménez, its London director, said. He believes it is also related to a Spanish government decision to give citizenship to anyone whose Jewish ancestors were persecuted in Spain in the 15th century.

“Spain felt that we had a historical debt to Sephardic Jews because they had been expelled from Spain and Portugal,” he said.

Since June 2015 anyone can acquire Spanish citizenship, without living in Spain and without renouncing their current nationality, if they can show they are descended from Jews forced to leave Spain by the Alhambra decree signed by the joint Catholic monarchs, Isabella I of Castile and Ferdinand II of Aragón, in 1492. But the offer ends in October this year, which Peyró believes has accelerated the number of applications.

“It can take only a few months to learn, so there is still time,” Peyró said.

Andrew Whitworth, 32, took the exams last year and is waiting to find out if his application for a Spanish passport has been successful.

“My mother had mentioned that we had this Sephardic heritage which allows us under a relatively recent law to gain Spanish citizenship. My great-grandfather converted. I’ve got lots of Spanish friends and connections, so it was a very positive choice for Spain.”

He said he had been looking at applying before Brexit. “The main pressure on the citizenship application is the ending of the Spanish law this October, but of course, Brexit kind of makes it more worthwhile.”

The latest Eurostat figures, for 2017, show 14,911 Britons becoming citizens of another EU country, a total rise of 127%. Portugal has a similar law accepting descendants of Sephardic Jews as citizens, but has no deadline for applications.

Although the numbers of children studying German or French at GCSE has fallen by about two thirds since 2004, Spanish GCSEs have been increasing, with a total of 90,544 students sitting exams in 2017.