A blood test that reads genetic results like a barcode can pick out the most aggressive prostate cancers, say experts.
The test, which looks at the signature pattern of genes switched on and off in blood cells triggered by the tumour, can sort the "tigers" from the "pussycats".
London's Institute of Cancer Research trialled the test in 94 patients.
The findings are published in the Lancet Oncology medical journal.
Prostate cancer is a very diverse disease - some people live with it for years without symptoms, but for others it can be aggressive and life-threatening.
Currently, doctors take a small sample of the tumour - a biopsy - to examine under a microscope to get a better idea of how dangerous it is.
Experts hope that ultimately the barcode blood test could be used to make a more accurate estimation.
In the study, the scientists were able to split the patients into four groups based on the results of the barcode test. One of these groups fared far worse, surviving for significantly less time than the other patients.
The researchers then confirmed their findings in another 70 US patients with advanced cancer, which revealed that nine genes could accurately spot who had the least chance of survival.
Patients with this "bad" gene signature survived for an average of nine months compared with 21 months for those without it.
US researchers at the Dana-Faber Cancer Institute and the Memorial Sloan-Kettering Cancer Centre have also been testing a similar prostate cancer blood test.
Their six-gene test could split patients into high and low risk groups.
Prof Malcolm Mason, of Cancer Research UK, said: "These are important results.
"Not only do they point to a group of patients with advanced prostate cancer who do particularly badly, and who therefore may need different forms of treatment, but they also point to the possible role of the immune system in influencing how a cancer might behave.
"If the present results are borne out in further studies, we may have a new way of selecting the right treatments for the right patients."
Prostate cancer is the most common male cancer in the UK, accounting for almost a quarter of male cancers.
Each year, nearly 35,000 men are diagnosed and more than 10,000 die from the disease.