The US Food and Drug Administration has approved a first-of-a-kind drug that uses the herpes virus to infiltrate deadly skin cancer tumours, reducing their size in some cases.

The FDA is allowing the injectable drug Imlygic, made by Amgen Inc, to be used at first only on melanomas that cannot be removed surgically. The company said a single course would cost about $65,000 depending on the length of the treatment.

The drug is injected directly into tumour tissue, where it uses herpes as a Trojan horse to slip past and rupture cancer cells. The drug combines a gene snippet meant to stimulate the immune system with a modified version of the herpes simplex virus — the kind that causes mouth cold sores.

Despite the drug’s groundbreaking approach FDA officials stressed it had not been shown to extend life. Instead company studies showed that about 16% of patients injected with the drug saw their tumours shrink, compared with 2% of patients who took more conventional cancer drugs. That effect lasted at least six months.

Regulators stressed that Imlygic had no effect on melanoma that had spread to the brain, lungs or other internal organs.

Amgen said patients should be treated with the drug for at least six months, or until there were no more tumours left to treat.

The drug — known chemically as talimogene laherparepvec or T-VEC — divides into copies repeatedly until the membranes, or outer layers, of the cancer cells burst. Meanwhile the gene snippet produces a protein to stimulate an immune response to kill melanoma cells in the tumour and elsewhere in the body.

A 2013 review in the journal Molecular Cancer concluded that cancer-fighting viruses armed with genes that stimulate the immune system “are potent therapeutic cancer vaccines”.

The FDA has approved a string of new medicines dubbed immunotherapies, or immune-oncology drugs, that harness the body’s immune system to help attack cancer cells. The drugs have brought some of the first significant advances in patient survival in many years for some cancer types, particularly lung cancer and melanoma.