Now, the organisation has announced it will fund "a large scale clinical trial” for the drug, also known as pre-exposure prophylaxis, at a cost of up to £10m.

Aids charities welcomed the “life-changing” decision.

We encourage all those who may be at risk of HIV to ensure they get tested.Professor Kevin Fenton, director of health and wellbeing at Public Health England

But patients groups were cautious about the plans, at a time when the health service is facing the worst financial crisis in its history, amid lengthening waiting lists and increased rationing.

From next year, the drug will be offered to gay men who do not have HIV but are at high risk of being infected through unprotected sex.

So far, studies suggest the anti-retroviral drug, also known as Truvada, can reduce the risk of infection by more than 90 per cent.

Health officials said the large trial was needed to work out the best way to ensure take-up of the drug, examine the impact on HIV levels - and whether it increased rates of other sexually transmitted infections.

Patients will be enrolled on the trial over the next three years, with NHS England footing the £10m bill.

Health officials had previously said that funding the drug could mean children with cystic fibrosis, deaf children in need of hearing iimplants for hearing loss and amputees needing prosthetics could be denied treatment.

But last night health officials said drug companies had agreed to cut the prices, meaning such patients will not miss out.

However, three treatments, which including second stem cell transplants for blood cancer patients whose disease has relapsed have been refused funding.

NHS England said the decision not to fund the transplants along with a drug for high blood pressure and one for complications of kidney transplants, was taken because they did not show sufficient cost-benefit.

Dr Jonathan Fielden, deputy national medical director at NHS England, said the new HIV prevention trial had "in part, been made possible by the willingness of many pharmaceutical and device companies to come forward with lower and more responsible prices".

“We have however, had to make some tough decisions over what we are not able to fund at this point in time within the resources we have available,” he said, saying the drugs would be considered again next year.

NHS England has agreed to fund 10 new specialist treatments for rare diseases, as well as the HIV prevention programme.

Professor Kevin Fenton, director of health and wellbeing at Public Health England said: "Currently 13,500 people are living in the UK with undiagnosed HIV and we are still seeing around 5,000 new infections each year.

"Given we are in the fourth decade of this epidemic there are too many new infections occurring, and we need to use all tools available to save lives and money.”

"We encourage all those who may be at risk of HIV to ensure they get tested,” he said.

Last week health officials announced that up to 12 million people will be offered HIV tests.

They include 3.6 million people living in the most high risk areas who will be offered them whatever the reason for their visit to a GP.

Ian Green, chief executive of the Terrence Higgins Trust, said: "With 17 new HIV diagnoses made every day, we need to be bold and ambitious in our approach to HIV prevention - and this must include access to PrEP for all who need it.

"Preventing the spread of HIV is good news for everyone,” he said.

“Not only will this make a life-changing difference to each of these individuals by protecting them from an incurable and highly stigmatised condition, but for every person who would have become HIV positive without PrEP, the NHS will save £360,000 in lifetime treatment costs.”

“It worries me to be spending money on this at a time when the NHS is so strapped for cash, with so many patients being refused treatment, and waiting lists getting longer.”Joyce Robins, from Patient Concern

The charity said it was concerned that health officials would not commit to funding treatment after the trial ends.

The pills work by blocking an enzyme that would otherwise allow the infection to establish in the body, by making copies of itself.

Most Aids charities have called for the drug to be funded.

However, Michael Weinstein, president of the AIDS Healthcare Foundation in the US, has voiced concern that it could result in increased spread of the virus, given it is not 100 per cent effective, and could cause a rise in other sexually transmitted diseases.

Joyce Robins, from Patient Concern, expressed concern about the use of funding at a time when health services are struggling to cope with demand.

“It worries me to be spending money on this at a time when the NHS is so strapped for cash, with so many patients being refused treatment, and waiting lists getting longer,” she said.

Simon Butler, Head of Policy, at Anthony Nolan sad the blood cancer charity was “deeply disappointed” by the decision not to routinely fund stem cell transplants for patients who had suffered a relapse.

“This is the wrong decision. It will deny the chance of a cure to patients whose blood cancer or disorder has tragically returned,” he said.

The charity has seen more than 18,000 people write to the Health Secretary in protest, he added.

Christian charities have said the NHS should not fund the drug.

James Mildred, a spokesman from Christian organisation CARE, raised fears that funding the drug would encourage promiscuity.

“If this drug is ultimately made available on the NHS we think there is a danger it will end up promoting promiscuity and more hedonistic, but risky lifestyles,” he said.