An Inverness woman supplied heroin to a friend of her boyfriend who took a fatal reaction to the narcotic, Inverness Sheriff Court was told.
Ann McCallum, of Mackay Road, Inverness, admitted being concerned in the supply of the Class A drug in Rossal House, Island Bank Road.
Fiscal depute David Morton told the court that the 23-year-old woman had taken some of the drug herself and then gave it to a friend of her partner, Keith Richardson.
Occupants of the property became concerned when they could not get a response from Mr Richardson and his room was forced open.
Mr Morton added: “An ambulance was called but Mr Richardson sadly died.”
Defence solicitor Mike Chapman said: “My client is distressed that we are discussing what happened. She is very remorseful.
“She had bought a small amount of heroin for a small amount of people.”
Sentencing McCallum to be under social work supervision for 18 months and to carry out 100 hours of unpaid work, Sheriff Donald Ferguson told her: “This is a tragic case and underlines the dangers of this kind of lifestyle.”