Hospital staff treating an 87-year-old woman were shocked when they discovered bed sores so severe they could see her hip joint move.
Staff also said the wounds were "among the worst" they had ever seen and police were called in after Jamesina MacKenzie, a resident at Wyvis House Care Home in Dingwall, died in hospital a few days later.
The care home, on Station Road, was threatened with closure after the Care Commission ruled its standard of care was "unacceptable", but remains open.
A fatal accident inquiry into Miss MacKenzie's death started at Dingwall Sheriff Court on Monday.
Dr Roslyn Rankin, a consultant pathologist, told the inquiry that the elderly woman's death was caused by an infection from pressure sores.
She said: "If her sores had been treated earlier, this lady could have lived for many more years.
"One ulcer had gone through to the bone and you could see the femoral cap. When this wound was being dressed, you would have been able to see the hip joint working.
"They are caused by prolonged pressure on bony parts of the body incurred from lying in bed, restricting the blood flow to those areas and causing decay. They are avoidable."
Miss MacKenzie suffered sores on numerous parts of her body, including her left and right hip, pelvis, heel, buttocks and lower back.
Her nephew, Murdoch MacDonald, 61, told the inquiry: "She was lucid, very sharp and mobile. A very independent woman.
"But when she came up north, she wasn’t fit enough for independent living and she went into the Wyvis Care Home in December 2008.
"My wife is an ex-ward sister and noticed several things which my aunt complained about to her.
Miss MacKenzie complained to her family that she was not getting breakfast and was being left in bed until midday, Mr Murdoch said.
When she became ill he asked that she be moved to hospital but care home staff initially refused, saying that she was dying and should be left where she was, the inquiry heard.
When she was taken to hospital in Invergordon, staff said her pressure sores were among the worst they had ever seen, Mr Murdoch told the court.
The inquiry, which is expected to last all week, will formally establish a cause of death and can make recommendations to prevent another similar incident.