GPs are increasing the anguish of cancer patients by depriving them of pain relief, new research suggests.

A study found that terminal patients in the UK were often not prescribed powerful opioid painkillers such as morphine until just nine weeks before their death.

Many of them will have been suffering pain over a much longer period of time, said the authors.

Doctors are waiting too long before allowing patients with advanced cancer to have the drugs, they claimed.

Lead researcher Dr Lucy Ziegler, from the University of Leeds, said: "We have identified for the first time the relatively late onset and short duration of strong opioid treatment in cancer patients prior to death.

"This pattern of prescribing does not match population data which points to earlier onset of pain.

"Nine weeks before death is considered late in the course of the cancer trajectory."

The scientists used UK Cancer Registry data and medical records to investigate the fate of 6,080 patients who died between 2005 and 2012.

They found that 48% of the patients were issued prescriptions for morphine and other opioid painkillers during the last year of their lives.

Typically the time interval between first prescription and death was only nine weeks.

Late diagnosis could not explain the delay. On average, patients were diagnosed with their disease long before receiving opioids.

Dr Ziegler added: "Although the prevalence of pain is higher in patients with advanced cancer and towards the end of life, for many patients pain is experienced at many stages throughout the illness.

"In fact, pain is the most common presenting symptom at diagnosis.

"Our research highlights the need to prioritise earlier access to effective pain management for patients with advanced cancer."

The study found that over-60s were more likely to be prescribed painkillers late than younger patients.

Cancer sufferers who died in a hospice, rather than in hospital, at home or in a care home, were more likely to have been offered the drugs earlier.

One explanation for the findings, published in the journal Pain, may be concern over the so-called "opioid epidemic" - the over-use of potentially addictive opioid drugs, said the researchers.

NHS data showed that between 2000 and 2010 overall opioid prescribing soared by 466%. However, it only increased by 16% for cancer patients.

Previous studies have found that up to 86% of patients with advanced cancer will experience pain.

"Within the advanced cancer population there is a need to develop mechanisms to improve pain assessment and initiate a more proactive approach to prescribing, particularly for older patients," said Dr Ziegler.

"Effective pain control is fundamental to good quality of life. For patients who are approaching the end of their lives it is crucially important we strive to get this right and that we help them achieve the best quality of life possible."