Little is known about how the tumours become resistant to the treatment.

Researchers at the University of Edinburgh studied tumour samples from breast cancer patients who had been taking a type of hormone therapy called an aromatase inhibitor for up to two years.

None of the women had undergone surgery to remove their tumours.

The team looked at which genes were switched on and off in the tumours during treatment.

Tumour samples were taken before the women started hormone therapy, within the first few weeks and after four months of treatment.

This allowed the scientists to see how treatment affected the tumours over time.

They found hormone therapy almost immediately triggered changes in the genes that were switched on in the tumours.

These differences became more pronounced over time.

Crucially, they found subtle differences in the changes that occurred in tumours from women whose cancer had become resistant to treatment.

The team spotted chemical signatures – called epigenetic changes – were absent in tumours that developed resistance to hormone therapy but were present in tumours that had started growing again after shrinking initially.

These differences were present in the first weeks of hormone therapy, suggesting it may be possible to predict which women are likely to relapse.

The study was carried out at the Medical Research Council Centre Institute of Genetics and Molecular Medicine and the Edinburgh Cancer Research UK Centre at the University of Edinburgh.

Dr Andy Sims, of the MRC Institute of Genetics and Molecular Medicine, said: “Treatment resistance is hard to study and laboratory experiments often do not closely resemble the situation in patients. This is the first time we have been able to investigate genetic changes in individual patients’ tumours over time.

“We hope the findings will help to develop new tests that predict which women on hormone therapy are likely to relapse so that they can be offered alternative treatments.”

Dr Simon Vincent, Director of Research at charity Breast Cancer Now, which helped fund the study, said: “This is a promising early finding that could help us better understand how some breast cancers become resistant to therapy and what we can do about it. Drug resistance is a major hurdle that we must overcome if we are to finally stop women dying from breast cancer.

“It’s really encouraging that this study has identified epigenetic changes that may help predict which patients are more likely to see their cancer come back. We hope further research will now help to identify exactly when these changes may begin to appear and find ways to target them, enabling us to intervene at the right time.

“Through research like this, we hope to one day be able to identify when therapies are becoming less effective and when a change of treatment might be appropriate.”