John Bell, 44, who was accused of sexually assaulting an eight-year-old boy at a campsite near Loch Ness, died in custody on November 8 at HMP Inverness.
The alleged assault occurred in July when the child was inside his tent at the campsite while his parents were nearby. The boy's father heard his son's distress, woke up, and saw someone fleeing the scene.
"Every death, whether in prison custody or in our communities, is a tragedy for all those who knew and supported the individual," said a Scottish Prison Service spokesperson.
"Following the death of someone in our care, Police Scotland are advised, and the matter reported to the Procurator Fiscal."
Police Scotland has been informed of Bell's death. A Fatal Accident Inquiry (FAI) will be conducted in due course.
The accused in a sensitive child assault case at Loch Ness died in prison, and authorities are conducting a formal inquiry into the circumstances of his death.