A drug-addicted doctor watched his wife lose consciousness and struggle for breath after he injected her with heroin.
Ashley Sibery, 39, persuaded his partner Sital to take the class A drug after she asked him about his drug habit.
Mrs Sibery decided to confront her husband because of his erratic behaviour, Edinburgh Sheriff Court heard on Tuesday.
On Tuesday, Sibery pleaded guilty to a charge of culpable and reckless conduct before Sheriff Elizabeth Jarvie QC.
Depute fiscal Karen Rollo told the court on April 2 this year the couple had an argument about how Sibery had been acting.
She added: "He had admitted to her that he had spent the last two months injecting heroin into himself. She issued him with an ultimatum. She told him he had to stop taking the drugs or their marriage would be over.
"Bizarrely, he asked her if she wanted to try some. He told her that he had a small quantity of heroin remaining in the house and that he would give her it. He wanted her to experience the drug, to see what it was like. The heroin was then prepared and it was injected into her.
"Within a few minutes, she collapsed and lost consciousness. She started to have breathing difficulties. An ambulance was then called to the house. The paramedics who attended the scene recognised him as being a doctor.
"They managed to keep her breathing and also stabilised her condition. She was then taken to hospital and received treatment."
Sibery was arrested and told police what had happened.
Ms Rollo added: "The accused indicated that he had a heroin habit. He confessed to them that he had given his wife heroin. He told them that he wanted to relax her and deal with stress. He told the officers how she slipped into unconsciousness."
The court heard Sibery is now in the care of a consultant psychiatrist who is helping him to tackle his problems. The couple are still together.
Sheriff Jarvie told Sibery that she would pass sentence on him at a hearing next month.
STV Edinburgh, 11 September 2012 14:30 BST
Drug-addicted doctor injected wife with heroin 'to see how it felt'