TORONTO -- An Egyptian man branded as a threat to Canada's national security has failed in what could prove to be his final attempt at lifting the terrorist designation that has hung over him for the past 15 years.

In a decision that upholds in glowing terms earlier court rulings, the Federal Court of Appeal rejected a concerted challenge from Mohamed Mahjoub to the government's case against him.

The unanimous decision leaves Mahjoub, 56, of Toronto, who has always denied terrorism ties or associating with known terrorists after coming to Canada, with little chance of now escaping a designation that has haunted him since 2000.

"Terrorist organizations do not issue membership cards or keep membership lists," the Federal Court of Appeal said in a lengthy decision that runs to 356 paragraphs.

"(But) there are reasonable grounds to believe that Mr. Mahjoub was a member of two terrorist organizations and that, by maintaining contact in Canada with other terrorists, he was a danger to the security of Canada."

Among other things, the Appeal Court noted the father of three once held a senior position at a farm in Sudan owned by al-Qaida mastermind Osama bin Laden. Part of the farm, according to security sources, was used for terrorist training in weapons and explosives. Mahjoub lied about his associates after coming to Canada, the court said.

Mahjoub came to this country in December 1995 and claimed refugee status, which was granted within a year. However, in 2000, he was slapped with a national security certificate on the grounds that he had been a senior member of two Egyptian terror groups and was arrested pending deportation. Part of the intelligence against him was kept secret.

Because he faces a risk of torture if returned to Egypt, he has remained in Canada, essentially in a state of limbo. He was released from detention in 2009 under strict conditions, eased substantially since then, and which were upheld earlier this month.

Mahjoub's appeal consolidated challenges to three Federal Court judgments: that the security-threat designation was reasonable, the process he faced had been fair, and violations of his solicitor-client privilege did not warrant throwing out the case against him.

On all three issues, the Appeal Court sided with earlier rulings, going out of its way to praise how the lower court had imposed order on the "legal chaos" of a difficult case.

"For the benefit of others who one day may have to decide a case as complex this and who seek guidance, the Federal Court's seven sets of reasons -- 1,021 pages and 2,160 paragraphs of tightly-written, crystal-clear reasons -- are a model worthy of study and emulation, an example of the execution of the judicial craft at its finest," the Appeal Court said. "Even-handedness, neutrality, logic and clinical analysis were on display throughout."

The Appeal Court rejected Mahjoub's effort to argue the laws are unconstitutional given the government's reliance, in part, on evidence hidden from him for security reasons. The appointment of so-called special advocates, given access to the information so it can be tested before a judge in closed court, provides sufficient safeguards, the court said.

Mahjoub failed to show the lower court had made "palpable and overriding" mistakes in seeking to have the proceedings tossed on abuse-of-process grounds despite raising a "panoply of issues," the Appeal Court said.

Those assertions included not knowing all the evidence against him, that the security services had violated his right to stay silent or listened in on his calls with his lawyers, and that information against him was linked to torture or otherwise unreliable.

In all cases, the appellate court sided with judges who ruled earlier against Mahjoub, despite finding his rights had at times indeed been breached or other problems with the proceedings.

"True, occasionally mistakes and faults happened, and often remedies were needed to redress them," the Appeal Court said. "But individually or collectively, there is no factual and legal basis upon which the Federal Court could have permanently stayed these proceedings."

Mahjoub's lawyers did not respond to a request for comment.