Researchers also found that a small proportion of men were 'super responders' and were alive and well even after the trial had ended despite having had a very poor prognosis before treatment.
They found that one in 20 men with end-stage prostate cancer responded to the immunotherapy pembrolizumab - but although the number who benefited was small, these patients sometimes gained years of extra life.
The most dramatic responses came in patients whose tumours had mutations in genes involved in repairing DNA, and the researchers are investigating whether this group might especially benefit from immunotherapy.
The phase II clinical trial was led globally by a team at The Institute of Cancer Research, London, and The Royal Marsden Foundation Trust, and involved 258 men with advanced prostate cancer who had previously been treated and become resistant to androgen deprivation therapy and docetaxel chemotherapy.
Overall, 5 per cent of men treated with pembrolizumab saw their tumours actually shrink or disappear, while a larger group of 19 per cent had some evidence of tumour response with a decrease in prostate-specific antigen (PSA) level.
Among a group of 166 patients with particularly advanced disease and high levels of PSA, the average length of survival was 8.1 months with pembrolizumab.
Nine of these patients saw their disease disappear or partly disappear on scans. And of these, four were super-responders who remained on treatment at the end of study follow-up, with responses lasting for at least 22 months.
Meanwhile, a second group of patients whose PSA levels were lower but whose disease had spread to the bone lived for an average of 14.1 months on pembrolizumab.
The study also compared the effectiveness of pembrolizumab in men whose tumours had a protein called PD-L1 on the surface of their cancer cells and those whose tumours did not.
Targeting PD-L1 activity with pembrolizumab takes the 'brakes' off the immune system, setting it free to attack cancer cells.
Commenting on the findings, Professor Johann de Bono, Regius Professor of Cancer Research at The Institute of Cancer Research, London, and Consultant Medical Oncologist at The Royal Marsden NHS Foundation Trust, said "Our study has shown that a small proportion of men with very advanced prostate cancer are super responders to immunotherapy and could live for at least two years and possibly considerably longer."
Adding to it, Professor Paul Workman, Chief Executive of The Institute of Cancer Research, London, said "Immunotherapy has had tremendous benefits for some cancer patients and it's fantastic news that even in prostate cancer, where we don't see much immune activity, a proportion of men are responding well to treatment."