A man accused of shooting dead a launderette assistant meant instead to kill himself in front of her, the High Court has heard.
Marion Millican, 51, was shot as she ate lunch at her work in Portstewart, County Londonderry, in March.
Fred McClenaghan, of Broad Street, Magherafelt, has been charged with her murder.
Prosecutors told the court that Mr McClenaghan claimed her death was accidental.
The court was told the mother-of-four had been in a relationship with her alleged killer which ended months earlier.
Following Mr McClenaghan's arrest, a shotgun was recovered from an area between Portrush and Ballymoney.
Crown counsel Philip Henry said the accused was interviewed 14 times without speaking.
However, at one stage he provided a statement saying: "It was my intention to kill myself on Friday March 11 and that Marion would witness my suicide."
It added: "I did not intend to kill Marion. I did not intend to harm Marion.
"Marion's death was an accident and I am truly sorry."
The details emerged as Mr McClenaghan sought compassionate bail to attend the funeral of his grandmother.
Opposing his application, Mr Henry claimed he was capable of "extreme volatility".
Referring to the shooting, the barrister claimed it was pre-meditated rather than a spur-of-the-moment incident.
A defence barrister attempted to overcome concerns about McClenaghan's state of mind by saying he had neglected prescribed medication at the time of the incident.
The court was told he was now taking it while in custody.
State of mind
Mr Justice Hart accepted the relationship between the accused and his grandmother was close enough to qualify for compassionate release.
But refusing bail, he said: "I have to have regard to the circumstances surrounding the offence itself, because they clearly demonstrate a degree of pre-meditation that is deeply disturbing."
The judge said the possible impact of not taking his medicine had on McClenaghan's state of mind remained to be seen.
He added: "It does, however, seem to me to suggest he is someone who behaves on occasion in an irrational or irresponsible fashion."
Prosecution concerns about potential interference with witnesses was also taken into account, with Mr Justice Hart concluding it would be inappropriate to release McClenaghan.