The Canadian government's designation of an Egyptian man as a threat to national security is unreasonable, a federal court judge has ruled.

The decision in favour of Mahmoud Jaballah, a father of three, could see the end of an ordeal that first saw Canada brand him as a terrorist more than 16 years ago.

"I conclude that the security certificate filed by the minister is not reasonable and will be set aside," Federal Court Judge Dolores Hansen said in her decision.

Story continues below advertisement

"Classified reasons will also be issued and will include the information that cannot be disclosed for reasons of national security."

The public reasons for Hansen's decision were not immediately available Tuesday.

The government has long insisted that Jaballah, now 54, was a ranking member of the Vanguards of Conquest, an Egyptian group linked to al-Qaida. Jaballah also worked on an agricultural project in Sudan run by former al-Qaida leader Osama bin Laden in the early 1990s.

His lawyers argued the government had failed to produce independent evidence that Jaballah ever committed, or would commit, terrorist acts. They also said Canada's spy agency had made no attempts to investigate or verify information about him it was given by foreign intelligence services.

A beaming Jaballah, of Toronto, who came to Canada in 1996 and was initially granted refugee status, was not immediately able to comment on Hansen's ruling due to court-imposed conditions, but his lawyer, Marlys Edwardh, told The Canadian Press it had been a long and difficult ordeal.

"He has spent earlier on years in a maximum-security setting, part of it in solitary confinement...merely because of the allegations," Edwardh said.

A spokesman for the minister of public safety said the ruling was under review and the government would have no immediate comment.

Story continues below advertisement

Jaballah was originally arrested in Canada in 1999 under a highly criticized national security certificate based largely on secret evidence he was not allowed to see. That certificate was quickly deemed unreasonable, but the government issued a second one in 2001, which was upheld in 2003 after the government argued it had new secret evidence against him.

In 2007, the Supreme Court of Canada ruled the national certificate process to be unfair because of the secrecy, and quashed the certificates but gave the government a year to rewrite the rules. As a result, Ottawa appointed special advocates — lawyers with top-level security clearance able to review the government's secret evidence.

In 2008, the government issued the third certificate against Jaballah — the one Hansen has now found unreasonable.

"It is a long, deeply challenging road to have walked," Edwardh said.

In previous years, the Canadian Security Intelligence Service admitted listening in on calls between Jaballah and his lawyers, and, in 2011, government lawyers mistakenly took files belonging to his defence.

Jaballah has said that he was jailed without charge and tortured on several occasions in Egypt. He staved off deportation to Egypt on the basis he would likely be tortured there.