MONTREAL — It has all the makings of a Cold War drama: Russian sleeper spies posing as a suburban family in North America, children who say they were oblivious their parents were Russian agents and an elaborate F.B.I. operation unmasking the shadowy ruse.
On Thursday, Canada’s Supreme Court ruled that the younger son of real-life Russian spies who helped inspire the television series “The Americans” is entitled to Canadian citizenship, after a protracted legal battle in which he argued that children should not be punished for the sins of their parents.
The case centers on Toronto-born Alexander Vavilov, now 25, who returned to Russia with his brother, Timothy, after their parents — Andrey Bezrukov and Elena Vavilova — were unmasked as spies and arrested by F.B.I. agents in the United States in 2010. The arrests were part of the unraveling of a Russian espionage ring that had used high-tech gadgetry and detailed cover stories to collect political gossip and policy talk about the United States.
Under Canadian law, people born in Canada have the right to Canadian citizenship with rare exceptions, including if they are children born to diplomatic officers or employees of a foreign government.
The legal battle began in 2010, when Alexander Vavilov’s application to renew his Canadian passport was denied. His Canadian citizenship was later revoked by immigration authorities on the grounds that his parents were employees of Russia who had been in Canada for espionage.
In 2016, after a Canadian lower court upheld the immigration officials’ decision, Mr. Vavilov won an appeal at a higher court. Then, the Canadian government appealed that decision to the Supreme Court of Canada, the highest legal authority.
In its ruling on Thursday the Supreme Court said it was unreasonable to apply the exception to the right of citizenship by birth to Mr. Vavilov given that his parents were not consular or diplomatic officials who had enjoyed immunity or privileges under Canadian law.
Mr. Vavilov “did not know that his parents were not who they claimed to be,” the court wrote. “He believed that he was a Canadian citizen by birth, he lived and identified as a Canadian, and he held a Canadian passport.”
“The relief I feel is indescribable,” Mr. Vavilov said in a statement read by his lawyer. “I can finally take a deep breath and relax knowing that my citizenship is secure and no longer the subject of attacks and doubts. It is a recognition that not only do I feel Canadian but I am Canadian in eyes of the law.”
Hadayt Nazami, Mr. Vavilov’s lawyer, said the brothers had the right to Canadian citizenship since they were innocent victims who were unaware their parents were working as spies. Moreover, he said their parents were not officially working for the Russian government when they were in Canada.
“These are innocent people caught up in this bigger game between superpowers,” he said by phone. “At the time they were children. We do not use citizenship laws to try to punish people for something their parents have done.”
The back story of the Vavilov family is the stuff of a spy thriller — which it helped inspire with “The Americans.”
After being trained in Russia, Mr. Vavilov’s parents moved to Toronto, where they took on the names of Canadians who had died as infants — Tracey Lee Ann Foley and Donald Howard Heathfield. The couple started a successful diaper business and had two boys — Timothy in 1990 and Alexander in 1994.
After a period of living in France, the family moved to the United States in 1999, and eventually lived in Cambridge, Mass., where Mr. Bezrukov undertook graduate work at Harvard.
But the couple were being monitored by the F.B.I. as part of a sprawling Russian spy ring that had rigorous training and undercover identities and included sleeper spies in Yonkers, N.Y., Manhattan, New Jersey, Boston and Virginia. The couple pleaded guilty to spying for Russia and returned to Russia as part of a swap with American spies arrested in Russia.
In an affidavit submitted to one of the Canadian courts, Alexander Vavilov said he had grown up believing he was Canadian, had learned French and English in deference to his Canadian heritage, and had been shocked and “traumatized” to discover that his parents were spies.
“I remember vividly the F.B.I. agents entering our house with weapons as I walked down the stairs,” he wrote.
“My parents were handcuffed in front of my eyes. Canada will always be my home,” he added. “It is the only culture I can associate with, and has been a cornerstone of my identity.”