A small proportion of men -- described as "super responders" -- remained well even after the trial ended, despite a very poor prognosis before the treatment, the researchers found.
The drug was found to be effective in treating advanced head and neck cancers.
Immunotherapy uses the immune systems of individuals to recognise and attack cancer cells. It is in use as standard treatment for some cancers like melanomas, and being tested on many others too.
The study found that one in 20 men with advanced prostate cancer responded to the drug pembrolizumab, and saw their tumours actually shrink or disappear altogether.
A relatively small number of them gained years of extra life, a study in the Journal of Clinical Oncology found. A further 19 per cent saw some evidence of improvement.
But most patients in the study lived for an average of eight months on the drug.
The phase II clinical trial, led by the Institute of Cancer Research and the Royal Marsden, involved 258 men with advanced prostate cancer who had run out of all other options on treatment.
The most dramatic responses were seen in patients whose tumours had mutations in genes involved in repairing DNA.
Researchers are now investigating whether this group might benefit the most from immunotherapy in a larger trial.
But first, a test to pick out who will respond best is needed, so that doctors know which patients to give it to.
Last week, a separate trial found that the same drug kept some people's advanced head and neck cancers at bay for an average of two years - five times longer than under chemotherapy.
Both studies are part of a growing body of research that suggest that immunotherapy could offer hope to an increasing number of cancer patients.