Canada is to deport a suspected Russian spy after the man admitted he was not Canadian and had been there illegally.
The man, who used the false name Paul William Hampel, was held at Montreal airport last month with a fake birth certificate, court documents said.
A federal court found the security certificate used to arrest him was "reasonable" and ordered his removal.
The man, whose real identity was not revealed, did not testify in court and did not admit to being a spy.
"My client admits that he is not Paul William Hampel, that he is a Russian citizen, born on October 21, 1961, and that he has no legal status in Canada," Stephane Handfield said.
"He is ready to leave Canada, but he does not admit being a spy," he added.
The intelligence agency said the man had spied on Canada for 10 years and worked for a successor to the Soviet KGB, the Foreign Intelligence Service (SVR), which deals with foreign operations and intelligence-gathering.
Court papers said he had obtained three Canadian passports by fraudulent means.
The Canadian authorities say that when they arrested the man he was carrying more than $5,000 in various currencies and three mobile phones.
The spying charges are the first since 1996, when Canada expelled Dmitriy Olshevsky and Yelena Olshevskaya, who had taken the names of Ian and Laurie Lambert to work as sleeper SVR agents.