Mohamed Harkat said Friday he was badly shaken by a judge's ruling that declared him a security threat to Canada, a ruling his lawyers are vowing to appeal.

"I can't sleep. I'm not thinking straight. I have pain in my stomach," the Algerian-born Harkat told a news conference

Federal Court Justice Simon Noel upheld the security certificate under which the 42-year-old Harkat, a former gas bar attendant and pizza delivery man, was arrested in 2002. The judge said Harkat is a threat to Canada and linked him to Osama bin Laden's terror network.

Harkat insisted that he told the truth in his testimony and has consistently denied the allegations against him.

He said he was being made a scapegoat by the government and security officials. "Somebody has to pay the price. I pay the price."

But in his ruling, released Thursday, the judge said Harkat's testimony was not credible or honest, but rather a carefully memorized story.

"He has surrounded himself in layers of clouds in which he does not let any light come through," Noel wrote. "At times, his testimony was simply incoherent, implausible if not contradictory."

Sophie Harkat told the news conference that the ruling came as "a punch in the guts" to her and the rest of her husband's family and friends.

"Never in a million years did we ever expect a judgment like this," she said. "This document in my opinion is a load of bull ... We will never, ever accept this judgment. We asked for the truth and this is not the truth."

Matt Webber, one of Harkat's lawyers, told CTV's Canada AM that the judge's finding was based almost entirely on evidence heard in secret, and said he was never allowed to respond to the accusations against his client.

"Numerous findings of fact were made against my client based on evidence I didn't know about," he said. "It's frustrating to say the least and we have every intention of appealing."

That appeal may also include a constitutional challenge of the security certificates under which Harkat was arrested eight years ago.

That law was later struck down by the Supreme Court of Canada, but Harkat was re-arrested two years ago under a certificate issued two years ago. He was later released on bail under strict house arrest conditions.

Harkat is accused of having ties with at least two high-profile al Qaeda operatives and of operating a safehouse in Pakistan for an Islamist extremist, and of helping facilitate the movement of money and people for al Qaeda in Ottawa.

But much of the evidence against him was heard by Noel in secret because of the sensitive nature of the material.

Neither Harkat nor his lawyers heard that evidence, although it was also heard by special advocates -- lawyers who serve as watchdogs and test federal evidence against the person facing deportation.

The advocates did not report the classified evidence to Harkat's lawyers and Webber called that fundamentally unfair.

"We've still come through this case not knowing what many of the allegations are based on. How can we possibly respond to these allegations?" he said.

"You need to be able to answer your accusers; you need to be able to defend yourself and at the end of the day it's unfair … because we could not effectively defend him."

In a separate ruling, Noel upheld the constitutionality of the national security certificate system the government is using to remove Harkat from Canada.

The defence had argued that Canada's spy agency CSIS kept information that may have exonerated Harkat under wraps. But Noel said there was no evidence of abuse of process.

The rarely used security certificates allow the government to detain and deport permanent residents or foreign nationals without revealing all the evidence against them.

However the judge has invited Harkat's lawyers to submit questions to the court that might form the basis of a challenge in the Federal Court of Appeal.

Harkat has steadfastly denied any involvement with terrorism and says he faces torture if sent back to Algeria.

He said Friday that the decision, which could pave the way for his deportation to his native country, made him physically ill. "I'm really devastated."