(AP) Britain's state-funded health service is responsible for paying for an HIV-prevention drug that has been called a "game changer" in the fight against AIDS, a court ruled Tuesday.

The health service said it would appeal, which means the drug -- which advocates say can prevent infection in people at high risk of contracting HIV -- is still some way from becoming widely available in Britain.

The National AIDS Trust charity argued that health authorities have an ethical duty to fund pre-exposure prophylaxis, or PrEP, a daily treatment that greatly reduces the risk of becoming infected with HIV.

The National Health Service argued that it "does not have the legal power to commission PrEP," because preventative public health measures are the responsibility of local government.

Related: With HIV/AIDS Cases on Rise, PrEP is Now Part of The Prevention

Judge Nicholas Green said there was a strong case for preventative treatment, "but one governmental body says it has no power to provide the service and local authorities say they have no money."

The judge ruled that the health service "erred in deciding that it has no power or duty" to commission the treatment.

"The power of NHS England includes commissioning for preventative purposes, and this includes for HIV-related drugs," Green said.

The NHS -- which supplies free or subsidized prescription drugs to all Britons -- could still decline to prescribe the drug if it decides it is not good value for money. It estimates it would cost between 10 and 20 million pounds ($13 million and $26 million) a year to make it available to those at high HIV risk, including people with HIV-positive partners and those who have frequent sex without condoms.

The health service said it would appeal Tuesday's ruling, but in the meantime would also review the case for PrEP, and would ask drug company Gilead -- which markets the drug under the name Truvada -- to lower its asking price. The NHS said that "would clearly affect the likelihood that their drug could be commissioned."

Some have argued that the drug might encourage high-risk, unprotected sexual behavior, but it has been endorsed by the U.S. Centers for Disease Control and the World Health Organization.

Dr. Michael Brady, medical director of AIDS charity the Terrence Higgins Trust, said the drug was a "game changer" that would "significantly increase the momentum in our fight against the virus."