The branding of an Egyptian man as a terrorist threat to Canada is reasonable even though the government violated his constitutional rights, Federal Court ruled Friday.

The ruling upholds the national security certificate Ottawa imposed on Mohamed Mahjoub that has severely restricted his freedom for the past 13 years, even though he has never been charged with any crime.

Judge Edmond Blanchard also issued a declaration that Mahjoub's "right to a fair trial pursuant to Section 7 of the Charter and right to be free of unreasonable search and seizure have been violated."

However, Blanchard opted against any further orders.

"Except for this declaration, no further relief is granted for the above violations," he wrote.

Reasons for decision pending

The judge gave no reasons for his decision — to allow time for them to be scrutinized for any possible security issues.

Mahjoub was not immediately available to comment, but the ruling shocked his lawyer, Yavar Hameed.

"It doesn't make sense," Hameed said minutes after the decision came down Friday.

"A violation of rights to a fair trial and abuse of process are serious matters, so the fact that this hasn't amounted to a stay of proceedings or other relief is very surprising."

Public Safety Minister Steven Blaney said in a tweet he was "very pleased" the court had upheld Canada's security-certificate system.

Mahjoub's supporters immediately called for a rally outside Federal Court to show their dismay.

One supporter, Mary Foster, called the ruling "cowardly and irrational."

"It is heart-breaking, condemning Mr. Mahjoub to yet more years of this slow torture," Foster said.

"This has certainly just made us angrier and even more resolved to challenge this system."

Mahjoub, 53, a Toronto father of three, has been fighting government allegations that he was a ranking member of a terrorist group in Egypt that may — according to the evidence — never have existed: the Vanguards of Conquest.

Records destroyed

What emerged over years of hearings is, among other things, that the Canadian Security Intelligence Service destroyed the original records it used as a basis for claiming Mahjoub poses a threat.

In addition, the spy service admitted foreign agencies that provided intelligence to Canada were linked to torture, but made no effort to filter out the information.

Security officials also admitted they repeatedly listened in to Mahjoub's calls with his lawyers in violation of the sacrosanct concept of solicitor-client privilege.

Hameed said he hoped the written reasons would clarify the apparent contradiction in Blanchard's decision.

"The fact that the court has recognized the existence of abuse is significant, but our view has been and remains that the level of abuse in this file is unprecedented," Hameed said from Ottawa.

"I don't know of any other certificate file or any other file that has even approached the level of abuses that we've seen in this matter."

The lawyer said the intention was to appeal, but the grounds would depend on the reasons Blanchard provides.

Mahjoub arrived in Canada in 1996 and was accepted as a refugee. He was arrested in June 2000 and placed under a national security certificate, which allows for indefinite detention without charge or trial.

Canada wants to deport him to Egypt, where he says he would be tortured.

Released in 2007 under stringent house-arrest conditions, he opted to return to prison two years later rather than subject his family to the intrusive restrictions.

In 2008, the Supreme Court of Canada ruled the security-certificate regime unconstitutional, but the government amended the law, and reimposed one on him and four other Muslim foreigners.

Mahjoub was finally released in November 2009, again under rigid bail conditions. Since then, the courts have eased the restrictions substantially but he remains far from free.