An official audit of more than 500 patients whose heart stopped while in hospital found that in many cases this could have been prevented with better care.
The National Confidential Enquiry into Patient Outcome and Death in the UK found that warning signs that the patient was deteriorating were not recognised in a third of cases.
In 10 per cent of cases, Cardiopulmonary resuscitation (CPR) was attempted even though the patient or their doctors had already decided against it, which the authors said was "poor" and should not happen, the Daily Telegraph reported.
It means patients were subjected to "undignified and unjustified" CPR needlessly when they should have been allowed to die peacefully, the authors said.
Dr George Findlay, the lead author of the report, said there are times when patients should not undergo CPR.
"In our study we found that there were cases when it was recognised that the patient was deteriorating but it should have been recognised that it was part of the dying process and it was inevitable that the patient was going to die," he said.
More From This Section
"Within this study it was felt that there was quite a lot of these patients but unfortunately they had CPR. Part of good care is recognising that this patient should not have CPR, it is not dignified and it is not effective."
The authors recommended that all patients admitted as an emergency be assessed by doctors and a decision taken over whether to attempt CPR should their condition deteriorate.
Dr Findlay said good doctors should be able to tell the patients who are otherwise quite well and stand a good chance of recovery and who CPR is appropriate from those who are very sick with lots of complicated problems and who are not going to recover.
Patients should also be involved in these discussions where possible so their wishes can be recorded and everyone involved knows whether CPR should be attempted or not, he added.