A Canadian court freed suspected Al Qaeda collaborator Mohamed Harkat from jail on Friday, but ordered him to remain under house arrest until his next hearing.

An Algerian refugee living in Ontario since 1995, Harkat was arrested in December 2002 on suspicions that he is an Islamic extremist and member of Usama bin Laden's terrorist network. Harkat has vehemently denied the allegations.

Harkat spent 3 1/2 years in an Ontario jail under Canada's controversial security certificate regime, which allows authorities to hold a detainee indefinitely without charges and lets the government keep any evidence secret.

Harkat was released on bail in June 2006 because of delays in his deportation. But he was arrested earlier this week for allegedly violating bail conditions.

According to authorities, Harkat is supposed to live with both of his bail guarantors, his mother-in-law and her partner. However, the court heard that the couple no longer lives together in the same house full time.

In a ruling Friday, Federal Court Justice Eleanor Dawson said Harkat will be freed, but must stay inside his Ottawa residence until a court hearing Monday.

When Harkat was in court Thursday contesting his arrest, fellow foreign-born terror suspect Adil Charkaoui, who was also arrested and held under the security certificate regime, was also before the courts to stave off his deportation.

The Moroccan-born Charkaoui, a school teacher and part-time graduate student in Montreal, is also accused of being an Al Qaeda sympathizer who should be deported. Charkaoui spent 21 months in jail before being released on bail in 2005.

Charkaoui denies any terrorist ties. The court reserved judgment on the case Thursday and set no date or a ruling.

Charkaoui and Harkat are among a trio of complainants who argued successfully last year that Canada's federal legislation dealing with the deportation of terror suspects was unconstitutional.

The Supreme Court of Canada ruled last February that the security certificate process that led to Harkat's incarceration is fundamentally unjust. A proposed new law is now being studied by the federal government.