It could mean some men with slower-growing tumours are spared unnecessary surgery while others are fast-tracked for treatment.

The test reads like a barcode genetic changes that indicate different prostate cancers, say scientists at The Institute of Cancer Research in London.

Professor Johann de Bono, senior study author, said: “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 – so it’s vital we develop reliable tests to tell the different types apart.

“We’ve shown it is possible to learn more about prostate cancers by the signs they leave in the blood, allowing us to develop a test that is potentially more accurate than those available now and easier for patients than taking a biopsy.

"Our test reads the pattern of genetic activity like a barcode, picking up signs that a patient is likely to have a more aggressive cancer. Doctors should then be able to adjust the treatment they give accordingly.”

Dr Kate Holmes, head of research at Prostate Cancer UK, said if confirmed by a larger study the test could help patients and their doctors "to make much more informed decisions about which treatments are best".