Scientists have identified key changes in immune cells within cancerous tumours that could help improve the development of treatments.
The study also found a set of genes that are expressed at high levels in breast cancer tumours and linked to more aggressive cancer types.
Researchers say the discoveries offer clues to diagnosis and predicting patient survival and reveal significant insights into how tumours behave in common cancers.
Immune cells normally help the body stay healthy by warding off pathogens such as viruses and bacteria. However, sometimes immune cells can wrongly identify cancer tissue as healthy tissue, aiding the spread of tumours.
Researchers therefore focused on the role of immune cells in endometrium - the womb lining - and breast cancers. Until now, little was known about how these cells behave in human cancer, making them difficult to spot and target.
They found differences in white blood cells known as monocytes present in the blood of breast and endometrial cancer patients compared with those in healthy individuals.
The discovery could accelerate the development of biomarkers - indicators of disease that allow doctors to spot cancer and track how patients respond to treatment.
The researchers also identified 37 genes that were highly expressed in breast cancer tumour immune cells - known as tumour-associated macrophages (TAMs) - compared with healthy tissue.
This genetic signature is particularly strong in aggressive cancers, including triple negative breast cancer, which is notoriously difficult to treat.
It is also linked to shorter survival in patients, suggesting that it could be used to improve the accuracy of breast cancer prognosis.
The scientists used this discovery to identify specific genes within the signature that could be targeted with future treatments. They honed in on two genes - SIGLEC1 and CCL8 - which were found to be linked to patient survival.
The study, published in the journal Cancer Cell, was funded by Wellcome and the National Institutes of Health.
Professor Jeff Pollard, Director of the Medical Research Council Centre for Reproductive Health at the University of Edinburgh, who led the study, said: "These studies are the culmination of eight years' of experiments and show convincingly that tumour-infiltrating immune cells are vital to understanding cancer spread.
"Tumour macrophages and monocytes show promise as markers for cancers and may help doctors make a prognosis, as well as opening routes to drug discovery.
"More research is needed to understand how we might harness this information to create new therapies, but our results suggests that the strong 37 gene signature should be a focus of study for breast cancer."