A breast cancer patient should have the drug Herceptin, according to a landmark ruling from the Court of Appeal.
Ann Marie Rogers of Swindon, Wilts, was appealing against an earlier High Court decision upholding Swindon Primary Care Trust's refusal to fund Herceptin.
Ms Rogers, 53, had said she faced a "death sentence" without Herceptin.
The Appeal Court ruling does not force local NHS bodies to fund the drug, but it said it was irrational to treat one patient but not another.
The judges said the ruling would not "open the floodgates" as only women who met the clinical criteria for Herceptin would qualify for the drug.
It is estimated that around 5,000 women could be able to get the drug, because of the ruling, costing the NHS around £100m a year.
Swindon PCT had argued that it would only fund the drug for patients in "exceptional circumstances", and that the drug was not licensed for the treatment of early-stage breast cancer, which is the kind Ms Rogers has.
But the Court of Appeal judges ruled that the PCT's policy was "irrational and unlawful".
They ruled that the focus should be what a doctor felt was right for their patient.
They ruled that: "In the case of personal characteristics, there is no rational basis for preferring one patient to another".
Ms Rogers, said she was "extremely delighted and relieved" at the Appeal Court's "humanitarian" judgement.
"I've got my life back. It's like winning the lottery.
"I couldn't have asked for a better verdict. I did this for all women battling this dreadful disease.
"I believe everyone prescribed this treatment by their doctor should be given the same health care wherever they live.
"I can now look forward to the future and have more confidence that I will win this battle against breast cancer."
Yogi Amin, of solicitors, Irwin Mitchell, who represented Ms Rogers, said "This truly landmark judgement makes clear to PCTs that they cannot overlook the clinical needs of the patient.
"People need to be confident that they will receive the drugs their doctor prescribes for them and it is therefore good news for doctors and patients alike."
He said ministers now needed to set out clear guidance on how drugs should be funded by PCTs.
In a statement, Swindon PCT said: "Although the judgement said generally our policy on funding is lawful, we accept that when considering this case and exceptional circumstances we should have taken costs into account to make our decision more rational."
It said it would consider its policy, taking into consideration the points made by the court.
Herceptin targets the HER-2 protein, which can fuel the growth of breast tumours.
Around a fifth of breast cancers are HER-2 positive.
A year's treatment with the drug costs an estimated £20,000.
The treatment is currently licensed for the treatment of advanced breast cancer but not for early-stage breast cancer, which research has suggested it could also help.
Makers Roche submitted their licence application for early-stage breast cancer to European drug authorities in February.
Once that is granted, NHS drugs watchdog the National Institute for Health and Clinical Excellence (NICE) promised to fast-track its appraisal if Herceptin is cost-effective.
That process is set to be completed later this year.
Joanne Rule, chief executive of the charity Cancerbackup, said: "From now on treatment should depend on clinical need and not on where you live, how much money you have, or how "exceptional" you are.
A Department of Health spokeswoman said the judgement provided clarification to PCTs.
"As is the case with other unlicensed drugs, clinicians can take the decision to prescribe Herceptin to patients with HER2 positive early breast cancer.
She said PCTs should not rule out treatments on principle, but consider individual circumstances and not refuse to fund Herceptin solely on the grounds of cost.
Shadow Health Secretary Andrew Lansley said: "Without national guidance from the Department of Health, many PCTs have been left to draw up arbitrary criteria which have forced some women to go without this essential treatment.
"Following this judgement, Patricia Hewitt now needs to live up to the pledge she made to women in October - and ensure that women across the country who have a clear, clinical need for Herceptin are provided with it."