North America's only legal drug-injection site can stay open, Canada's Supreme Court rules, in a defeat for the country's conservative government.
The supervised injection site opened in Vancouver in 2003 with a federal exemption permitting illegal drug use.
Its supporters say it has helped prevent overdoses, reduced infections, and curbed crime and open drug use.
But the federal government said in 2008 that the facility should close, arguing it promoted addiction.
The top court issued its unanimous 9-0 decision on Friday.
Addicts must bring their own drugs to the Insite facility, where they are supplied with clean needles and sterilised water. They inject at 12 stainless-steel alcoves with mirrors on the walls so nurses on a raised platform can see them.
The court said in its ruling that in the clinic's eight-year history, "Insite has been proven to save lives with no discernible negative impact on the public safety and health objectives of Canada".
"The risk of death and disease to injection drug users is grossly disproportionate to any benefit that Canada might derive from presenting a uniform stance on the possession of narcotics."
Correspondents say the ruling suggests the right of a province to provide healthcare supersedes the federal government's right to enforce drug laws.
It is thought that the Supreme Court's decision could pave the way for similar facilities to open in other parts of Canada.
The ruling was welcomed by users of the facility and healthcare professionals alike. A crowd celebrated on the street outside Insite.
"Addiction-related drug use is a health issue and not a criminal justice issue," Debra Lynkowski, chief executive of the Canadian Public Health Association, told reporters.
"Collectively, we have the responsibility to protect the health of all Canadians, no matter what their situation."
But Health Minister Leona Aglukkaq was disappointed with the decision.
She told the Canadian parliament: "Our government believes that spending more money on treatment and to help people get off drugs is the best investment we can make."
She added that the government would be reviewing the court's decision.
The facility has been operating under the constitutional exemption to Canada's Controlled Drugs and Substances Act.
But the federal government refused to renew the exemption in 2008, arguing that "harm-reduction" programmes diverted funding from addiction-treatment programmes.
The Supreme Court's ruling supports a decision made in 2008 by the Supreme Court of British Columbia.
As of 2009, there were 65 injection facilities in 27 cities in Canada, Australia and western Europe, according to the Canadian Medical Association Journal.