Forceps, needles, fragments of a bone drill and swabs are among the objects left inside Scottish patients during operations, it has emerged.
Some patients also had organs punctured accidentally while in operating theatres, the Press Association found.
Scotland's largest health board, NHS Greater Glasgow and Clyde, said six patients left hospital with swabs inside their body since January 2008.
The NHS board said the checks system it has in place failed on those occasions.
The hospitals involved are Glasgow Royal Infirmary, Southern General Hospital, Stobhill Hospital, Victoria Infirmary and Royal Hospital for Sick Children.
Greater Glasgow and Clyde said up to three people, from a total of 12 with objects left inside their bodies, became unwell as a result.
A spokesman said: "All swabs and instruments are counted in and out during every open operative procedure.
"During the operation the counts are recorded on a wall board in theatre.
"Several counts are done during the procedure and a final count at the end to ensure all is present and correct."
He said the final count was documented by the two members of staff who performed the count.
"However the system has not worked on these particular occasions," he added.
"All such incidents are reported within the organisation and undergo an investigation.
"The patients involved receive an apology from the principle clinician involved."
NHS Borders said forceps were left inside a patient at Borders General Hospital in June last year.
The health board said the object was missing at the end of the surgery
It said staff were alerted, the patient was X-rayed, re-anaesthetised and the forceps removed.
Needles and swabs
In May last year the bladder dome of an adult patient at the same hospital was accidentally torn during a total abdominal hysterectomy.
The tear was noticed immediately and was stitched.
NHS Grampian said eight incidents occurred between January 2008 and February 2010 in which objects were left inside or assumed to have been left inside patients.
The items included "minute" bone-drill fragments, as well as fragments of tubing, needles and swabs.
In six recorded cases in NHS Grampian, the uterus was punctured on five occasions and a patient's testicles were punctured in one case.
Five of the incidents took place at Aberdeen Royal Infirmary and one was at Royal Aberdeen Children's Hospital.
Since January 2008, fewer than five patients left hospital with swabs inside them after surgery.
NHS Tayside said eight objects, including the tip of a guide wire and the tip of a needle, were left inside patients during surgery.
The patients were at Ninewells Hospital and Perth Royal Infirmary but none became ill, were injured or died as a result of the mistakes.
Health boards insisted they had checks in place.
Dr Jean Turner, executive director of the Scotland Patients Association, said: "Patients expect to be safe at all times but especially when they are in an operating theatre and under an anaesthetic.
"The utmost care should be taken by all theatre staff, especially the sister in charge, the surgeon in charge and the anaesthetist to make sure that all swabs and instruments are counted at the start and match the count at the end before closing the wound.
"All swabs despite arriving in packs of whatever number, should be counted and not assumed to be the usual number of the pack.
"These checks, to my knowledge, are routine.
"No patient should have to endure another operation or have their life put at risk because the pre and post checks are not rigorously carried out."
The details were released after a Freedom of Information request to all 14 health boards in Scotland by the Press Association.