While his supporters were overjoyed at the unprecedented decision, a "disappointed" federal government immediately said it would appeal any interim release for the former Guantanamo Bay inmate.
"We have vigorously defended against any attempt to lessen his punishment," Public Safety Minister Steven Blaney said in a statement.
In her ruling, Court of Queen's Bench Justice June Ross found that Khadr has a constitutional right to apply for bail pending his appeal of five war-crimes convictions before a widely discredited American military commission.
She accepted evidence that he presents a low risk to public safety and has been a model prisoner — even though the federal government has branded him a hardened terrorist.
"This is a circumstance where balancing a strong appeal and the public confidence in the administration of justice favour the same result," Ross said in her decision.
"He has a strong basis for an appeal and the risk to public safety is not such that it is in the public's best interest that he remain in pretrial detention in a manner that could render his appeal irrelevant."
Ross did say Khadr would have to remain behind bars at least until May 5 while terms of his release are hammered out.
"Omar is fortunate to be back in Canada where we have real courts and real laws," Nate Whitling, one of Khadr's lawyers, said minutes after the decision.
"What you read in the paper from the government is a lot of hollow rhetoric."
There was no immediate word from the U.S. State Department.
The Toronto-born Khadr, now 28, is currently in the Bowden Institution north of Calgary, where he is serving out an eight-year sentence handed down by the military commission in Guantanamo Bay in 2010.
The Canadian Press has learned he was reclassified as a minimum-security prisoner from medium in the last few days.
Khadr has said he only pleaded guilty to the war crimes he was accused of committing as a youth to get out of Guantanamo and be sent back to Canada.
Several prominent citizens in Edmonton — including academics and business people — offered their support for his bail application. His longtime lawyer, Dennis Edney, and wife, Patricia Edney, offered to take him into their home.
Patricia Edney welcomed the prospect in light of Ross's decision.
"Sounds good to me," she said.
Dennis Edney, who has long championed Khadr's case, was thrilled at the unprecedented decision, which, he said, had been a long time coming.
"The Canadian government should never have allowed Omar to be in Guantanamo," Edney said. "It should be held accountable for participating in his torture there."
Whitling had argued that Khadr's appeal of his conviction stood a good chance of success — especially in light of other American court decisions — but was dragging on, meaning it might not be resolved before his sentence expires.
For its part, the government argued Ross had no jurisdiction to hear the bail application from an offender convicted abroad and returned to Canada. Giving him bail would undermine Canada's international relations and obligations, the government argued — a position Ross rejected.
It also urged her to take into account the fact that Khadr pleaded guilty to serious offences — including murder, in violation of the laws of war for the death of an American special forces soldier following a fierce firefight in Afghanistan in July 2002.
If he's released, Khadr will have to get used to living in Canada. He lived with his family before his arrest mainly in Pakistan and in Taliban-controlled eastern Afghanistan. His father was an associate of Osama bin Laden and the family stayed for a time at the terror mastermind's compound.
Edney rejected the government's characterization of his client as terrorist.
"Canadians will see and meet a different Omar Khadr than the one wrongly portrayed by the Harper government," he said.
Next month, the Supreme Court will hear the government's appeal of an Alberta court's decision that Khadr should have been treated as a juvenile offender. In June, he applies for parole for the first time. He is eligible for statutory release in October 2016, after serving two-thirds of his sentence, which expires in 2018.
Also on HuffPost