The high court upheld the national security certificate against Harkat, opening the door Wednesday to the next step in removing him from Canada.
Harkat, 45, has expressed fears he could be tortured if returned to his native Algeria, given the high-profile accusations against him, raising questions about how, when or even if he will be deported.
But he is beginning to run out of options in the long-running bid to clear his name.
The Supreme Court also rejected Harkat's constitutional challenge of the security certificate regime, unanimously ruling that the process — while not perfect — is consistent with the Charter of Rights and Freedoms.
"It's difficult to put it in words," Harkat's lawyer, Norm Boxall, said Wednesday after reading the decision. "I can't think of another word to say, other than it was devastating."
Added Harkat's wife, Sophie, as she and her husband were getting into a car to leave: "We will fight them all the way."
The former pizza delivery man was taken into custody in Ottawa in December 2002 on suspicion of being an al-Qaida sleeper agent. He denies any involvement with terrorism.
The federal government is trying to deport the Algerian refugee on a security certificate — a seldom-used tool in immigration law for removing non-citizens suspected of extremism or espionage.
Harkat's lawyers argued the process was unfair because the person named in a certificate doesn't see the full case against them.
In its ruling, the Supreme Court said the security certificate regime does not violate the person's right to know and challenge the allegations they face. However, the high court provided detailed guidance on applying the process to ensure it is fair.
Federal Court Justice Simon Noel ruled in 2010 that there were grounds to believe Harkat is a security threat who maintained ties to Osama bin Laden's terror network after coming to Canada.
On Wednesday, the Supreme Court concluded Harkat "benefited from a fair process" when Noel reviewed his case, meaning the certificate against him stands.
Last year, federal border agents removed an electronic tracking bracelet from Harkat's ankle. He was also given more freedom to travel, but was prohibited from leaving the country and told to check in with authorities regularly.
Public Safety Minister Steven Blaney applauded the Supreme Court ruling. But it was not immediately clear whether Canada would begin assessing the risk of returning Harkat to Algeria, or if it might seek a third country willing to accept him.
Because Harkat is a refugee, the federal border agency cannot deport him unless the immigration minister issues a "danger opinion" declaring him a danger to the Canadian public or Canada's security.
In addition, the agency noted Wednesday, anyone to be removed from Canada "is entitled to due process before the law and all removal orders are subject to judicial scrutiny."
Boxall said he hopes Harkat will never be deported, citing the peril that may await him in Algeria and arguing that Canadians have nothing to fear.
"Any risk here, even on the findings of the court, are minimal," Boxall said. "I mean, it's hard to identify what risk he presents."
Two other men — Mahmoud Jaballah and Mohamed Mahjoub, both originally from Egypt — could face removal from Canada in certificate cases.
The Canadian Council for Refugees, the Ottawa-based International Civil Liberties Monitoring Group and Amnesty International Canada expressed disappointment with the ruling.
Alex Neve, secretary general of Amnesty Canada, said he was "surprised and troubled" the Supreme Court did not ground its decision in the international human rights standards that Canada is obliged to uphold.
There have been numerous legal twists and turns in the path-breaking case.
In 2007, the Supreme Court struck down the security certificate regime, declaring it unconstitutional.
The federal government issued a revised certificate in Harkat's case in 2008 after the secretive process was overhauled to bring it in line with constitutional guarantees.
In revamping the security certificate system, the government introduced special advocates — lawyers with access to secret material who serve as watchdogs and test federal evidence against the person singled out in the certificate.
In April 2012, the Federal Court of Appeal ruled that summaries of some 1990s conversations be excluded from evidence against Harkat because the Canadian Security Intelligence Service destroyed the original recordings.
In its ruling, the Supreme Court unanimously disagreed, saying disclosure of the summaries in abridged form to Harkat and in their entirety to his special advocates "was sufficient to prevent significant prejudice to Mr. Harkat's ability to know and meet the case against him."
The appeal court also said in 2012 that human sources recruited by CSIS did not have the sort of blanket protection that shields the identities of police informants, even from the judge. In the case of CSIS, this is instead decided on a case-by-case basis.
The Supreme Court agreed Wednesday that there should be no overarching privilege for CSIS sources, saying the security certificate generally ensures that their identities remain "within the confines of the closed circle" formed by the reviewing judge, the security-cleared special advocates and federal lawyers.
Two judges — Rosalie Abella and Thomas Cromwell — dissented on the issue, saying CSIS informants are entitled to an assurance that the promise of confidentiality will be protected. "This can only be guaranteed by a class privilege, as is done in criminal law cases."
— With files from Terry Pedwell and Adrian Wyld
Follow @JimBronskill on Twitter
Also on HuffPost