Campaigners have failed in their High Court bid to force the NHS to fund Alzheimer's drugs in people with early-stage disease.
Protesters gathered outside the court
However, the National Institute for Health and Clinical Excellence (NICE) has been told to rewrite guidance on how the disease is assessed.
The Court upheld NICE's decision that the drugs are only cost-effective in later-stage disease.
It is the first time a judicial review had been sought on NICE guidance.
Drugs company Eisai brought the case to the High Court with support from fellow drugs firms Pfizer and Shire and the Alzheimer's Society and are now planning to appeal the decision.
They were successful on one count - that tests to assess Alzheimer's are discriminatory in people with learning difficulties or those who speak English as a second language.
But claims that NICE did not properly evaluate the impact of the drugs on the quality of life of carers and that the figures on the cost of long-term care used in their analysis were too low were not upheld by the court.
The judge dismissed two further claims of irrationality and procedural fairness.
That means patients with early-stage Alzheimer's will still not be recommended for funding.
NICE guidance in 2001 recommended the drugs - which can make it easier to carry out everyday tasks - should be used as standard.
But guidance published in November 2006, after months of appeals, stated that the drugs should only be prescribed to people with moderate-stage disease.
NICE said the drugs, which cost about £2.50 a day, did not make enough of a difference to recommend them for all patients and were not good value for money.
The Alzheimer's Society said they had won a very important point that NICE guidance is unlawful because it discriminated against significant groups of people.
But called the overall ruling "insulting and devastating news".
Andrew Dillon, chief executive of NICE said: "Our guidance stands and the drugs continue to be recommended only for people with moderate Alzheimer's disease, but the court has asked us to clarify our guidance when it is used for certain groups.
"Alzheimer's disease is a devastating illness, but the evidence indicates that these drugs are simply not effective for some patients.
"That is why we also issued advice last year on the broader support that should be provided for people with Alzheimer's disease and those who care for them, creating core standards for the NHS and care homes that will make a real difference for patients and their families."
Dr Paul Hooper, Managing Director of Eisai UK, said: "The guidance NICE has issued is morally reprehensible.
"They are denying patients access to early treatment and that is wrong."
Harriet Millward, deputy chief executive of the UK's largest dementia research charity, the Alzheimer's Research Trust, said: "We are devastated that these drugs will remain unavailable on the NHS to people with early-stage Alzheimer's when they might benefit from them.
"We urgently need to do more research to find better treatments, but research is currently hugely underfunded - we are scraping for every penny to fund vital work."
But Mervyn Kohler, Help the Aged special adviser said the ruling represented "some progress".
"It is important that NICE examines its guidance on these drugs, not just in the light of the ruling today but bearing in mind the public concern which the case has demonstrated."
Gordon Lishman, director general of Age Concern, said the ruling was disappointing.
"The drugs can cost as little as £2.50 a day per person and could make day-to-day life far more manageable for thousands of people."
But Professor Richard Gray, director of the University of Birmingham Clinical Trials Unit, said the court made the right decision.
"The benefits from these drugs for Alzheimer's disease are so small that the only way you can tell if a patient is taking the drug or taking a dummy tablet is if they get side-effects such as nausea or diarrhoea."