Three pensioners were murdered by a paranoid schizophrenic who was under the delusion he was uncovering a paedophile ring, a court has heard.
Alexander Lewis-Ranwell, 28, has gone on trial accused of the killing of Anthony Payne, 80, and 84-year-old twin brothers, Roger and Dick Carter in February.
The court heard he has admitted the killings but was pleading not guilty to murder on the basis of insanity.
Opening the case at Exeter Crown Court the prosecution revealed the victims were all killed in Exeter, Devon, just a couple of hours apart with Lewis-Ranwell using a hammer in one attack and a spade in the other.
The jury heard the motive was a mistaken belief from the defendant that he was uncovering a ring of child sex offenders.
Prosecutor Richard Smith QC,said: "He suffered delusions - a genuine belief something is the case when it was not so at all.”
Mr Smith said the defendant believed the victims were somehow involved in the ring but added: “They were the victims of course and not involved in any such things."
Mr Smith told the jury Lewis Ranwell, of Croyde, Devon, started his killing spree by murdering Anthony Payne with a hammer.
He told the court: "The defendant stopped at Mr Payne’s house and read a note on the door which spoke about the occupant being an elderly man of 80 years of age.
Read more from Yahoo News UK:
"The defendant went in through the front door and found or followed Mr Payne upstairs to the bedroom.
“The defendant took up a hammer and bludgeoned Mr Payne to death with blows to the head.”
About two and thee quarter hours later Lewis-Ranwell walked down Cowick Lane.
One of the elderly brothers who lived there tried to usher the defendant away from the house but Lewis-Ranwell went around the back of the house and found a spade, says Mr Smith.
He climbed over a wall and "once inside beat both brothers to death with blows to the head with the spade," Mr Smith said.
The prosecution and defence agree the defendant has a partial defence of diminished responsibility. It means the defendant has some responsibility for what happened.
Mr Smith told the jury there is no doubt that Lewis-Ranwell was suffering a mental illness at the time. The question for the jury is how much responsibility he has for the crimes he committed due to his state of mind at the time.
The court heard that Lewis-Ranwell was released from police custody on the morning of the killings after being arrested the day before over a violent attack on a farmer.
PC Robert Green said in a statement the attacker had grabbed his taser as he was being booked in. Lewis-Ranwell was taken to the floor by the officer and put in a cell.
According to the police officer Lewis-Ranwell urinated and spat in the cells and could only be interviewed with an appropriate adult as well as solicitor.
He made more claims about paedophiles and was aggressive, the policeman said. However he was released from custody on the morning of the killings.
The case has been adjourned.