Brian Thomas killed his wife Christine in a camper van
Prosecutors have defended bringing a murder charge against a man who blamed a sleep disorder after he killed his wife while he said he was dreaming about an intruder.
The Crown Prosecution Service (CPS) called it a "unique case with a set of unique circumstances".
Brian Thomas, 59, from Neath, had admitted killing his wife Christine, 57, in their camper van.
But Swansea Crown Court heard that his rare sleep disorder meant he was not in control of his actions at the time.
The CPS said it had to bring the case to court as a jury was needed to decide if Mr Thomas should be sent to a psychiatric hospital or not.
But it said following expert evidence from a psychiatrist in the case, it was decided that "no useful purpose would be served by Mr Thomas being detained".
Iwan Jenkins, chief crown prosecutor for CPS Dyfed-Powys, said the jury had been asked to consider the "unusual issue" of insane automatism - a sleep disorder known as "night terror".
He said there had has never been any dispute that Mr Thomas caused his wife's death, but the prosecution accepted that he should be found not guilty of murder or manslaughter, based on the evidence of a number of experts in the field of sleep-related disorders.
Further expert evidence led to a range of opinions on whether Mr Thomas presented any ongoing risk, and therefore whether he required further medical intervention.
"For that further treatment to be made a requirement, a special verdict of 'not guilty by reason of insanity' would be required," Mr Jenkins said.
"The law dictates that this is a verdict that cannot be determined by anyone other than a jury - which is why the case had to go to court.
"The death of Christine Thomas was thoroughly investigated by Dyfed-Powys Police. Investigations continued after Mr Thomas was charged and involved the instruction of experts in several fields.
"I must emphasise that the circumstances of this case are almost unique in the UK and there have been fewer than 50 instances recorded worldwide.
"It is only because of highly sophisticated tests carried out by sleep experts that Mr Thomas' condition could be confirmed."
He said once experts had said Mr Thomas did not pose a risk and should not be detained in a psychiatric hospital, the CPS reviewed the case and decided the public interest would no longer be served by continuing to seek a special verdict of not guilty by reason of insanity.
"Our thoughts remain with the family of Brian and Christine Thomas who have remained dignified throughout this difficult time," he added.
Meanwhile, an American psychologist who specialises in sleep disorders and gave evidence at the trial said he believed Mr Thomas killed his wife during what he called a "night terror".
It is when a person is suddenly aroused of a very deep sleep and does not wake fully which can lead them to act violently.
Dr Mark Pressman, who was involved in sleep tests that were carried out on Mr Thomas, said: "Unfortunately in this case the only direct witness is the victim so we have to pull together what we think he was doing from other types of evidence that we had that night.
"In this case, we have his own statement from the 999 call which you can listen to... that's what he thinks happened.
"We have the evidence from within the caravan itself which helps us understand the sleeping arrangements among other things then we add to that the more indirect evidence."
The indirect evidence included his medication, his previous history doing strange things in his sleep and his family history.
He added: "Then you pull it all together and try to reach a conclusion about what was most likely to have happened.
"Because there's no witnesses, we can't be absolutely sure but we can approach that."