Three police officers and a community support officer failed to deal with the complaints of a disabled man just 48 hours before he was brutally murdered in a vigilante attack.
The three constables let their dislike of the victim, Bijan Ebrahimi, influence their approach to a "toxic situation" outside his home where a neighbour was threatening to take the law into his own hands.
Lee James, 26, wrongly suspected Mr Ebrahimi was a paedophile and told police he would "do time to protect his children".
Two days later, at around 1am on Sunday July 14, James repeatedly punched and kicked the Iranian national unconscious outside his home in Capgrave Crescent, Brislington, Bristol before setting his body on fire with the help of his neighbour Stephen Norley, 26.
James admitted murder and was jailed for life while Norley received a four year sentence after pleading guilty to assisting an offender.
Bristol Crown Court heard that on the evening of July 11 Mr Ebrahimi dialled 999 and reported that James had come into his flat and assaulted him.
When police arrived at the scene they noted that James, a father of three young children, appeared so angry he was "foaming at the mouth".
But the officers arrested Mr Ebrahimi rather than James. And when he was released from custody the following day, he continued to seek help from the police but they failed to protect him, prosecutors allege.
Police Constables Kevin Duffy, 52, Leanne Winter, 38 and Helen Harris, 40, and police community support officer Andrew Passmore, 55, each deny a charge of misconduct in a public office.
Opening the prosecution case, Crispin Aylett QC said: "In short Mr Ebrahimi had fallen out with a number of his neighbours on a council estate in Brislington, south east Bristol.
"Some of them thought quite wrongly that Mr Ebrahimi was a paedophile."
The court heard that after the confrontation with James, Pcs Winter and Harris were dispatched to deal with his complaint.
"At the scene Lee James was so angry that he was later said by Pc Winter to be 'foaming at the mouth'," he told the jury.
"He was boasting he would 'do time to protect his children'. You may think that the degree of Lee James' anger and taking the law into his own hands could not be plainer.
"Worse still Lee James was not alone. A crowd had gathered outside Bijan Ebrahimi's flat and most, if not all of them, took Lee James' side. Put simply vigilantism was in the air."
Pcs Winter and Harris arrested Mr Ebrahimi and he was held in custody overnight, being released the following day.
"Thereafter they did nothing to ensure that Mr Ebrahimi's original complaint was properly investigated," Mr Aylett said. "Lee James's ugly threat was simply overlooked."
On the Friday Mr Ebrahimi made 12 calls to the police station hoping that Duffy, the local beat manager, whose job included tackling antisocial behaviour, would deal with his complaint.
"It is clear that Kevin Duffy did not like Bijan Ebrahimi and when various police operators asked Pc Duffy to call upon Bijan Ebrahimi - and he was asked a number of times - he said he was busy and he would go and see Bijan Ebrahimi in his own good time," Mr Aylett said.
"From the reaction of his calls it is perfectly clear that Kevin Duffy regarded Bijan Ebrahimi as a liar and in one call he described him as a 'perpetual liar' and also regarded him as a nuisance and the prosecution say he was not interested in dealing with Mr Ebrahimi's complaint.
"Pc Duffy never managed to find the time and instead he asked Andrew Passmore to patrol the area around his home address.
"After Mr Ebrahimi's death Mr Passmore claims he carried out 40 minutes on foot patrol and a further 20 minutes on the adjacent streets.
"The truth is that he couldn't have done more than drive around for a couple of minutes in his car."
On the Saturday Mr Ebrahimi again tried speaking to Duffy.
Mr Aylett told jurors: "The prosecution suggest had something been done, that Lee James would have realised they were at the very least keeping an eye on him. He must have thought he could simply do as he pleased.
"The prosecution suggest this was a potentially toxic situation that called for proactive and effective policing and that each of the four defendants failed Bijan Ebrahimi."
The prosecutor added: "This isn't a case of mere incompetence and the prosecution suggests that it is clear that Pc Duffy, Pc Winter, Pc Harris just didn't like Bijan Ebrahimi and they allowed their dislike of him to allow that to influence the way that they did deal with him."
Referring to Mr Passmore, Mr Aylett said: "The fourth defendant could have done nothing more than carry out the most cursory of patrols outside his house.
"Each of these four defendants is a police officer or a police community support officer of some years standing and no doubt each has a lot to be proud of during their years of service.
"On the other hand, the prosecution suggest, the failure of each of them fell far below that which the public are entitled to expect and that it amounts to the common law offence of misconduct in public office."