A judge on Wednesday dismissed charges against four social workers accused of missing red flags and failing to protect an 8-year-old Los Angeles area boy who was killed by his mother and her boyfriend after years of torture and mistreatment.

Los Angeles County social workers Stefanie Rodriguez, 35, Patricia Clement, 69, and supervisors Kevin Bom, 41, and Gregory Merritt, 64, were each been charged with one felony count of child abuse and one felony count of falsifying public records in connection with the May 2013 death of Gabriel Fernandez.

Prosecutors said the social workers left Fernandez in his Palmdale home with his mother, Pearl Fernandez, and her boyfriend, Isauro Aguirre, despite multiple investigations into alleged child abuse. Gabriel Fernandez was targeted for abuse because the pair believed he was gay, prosecutors said.

He was repeatedly beaten, starved, tied up and made to sometimes sleep in a cabinet, authorities said. An autopsy revealed the boy had a fractured skull, multiple broken ribs and burns on his body.

SLAIN ILLINOIS BOY, 5, TELLS MOTHER ‘I DON’T EVER SEE YOU AGAIN’ IN HEARTBREAKING TAPE HEARD AT MOM’S MURDER TRIAL

Gabriel Fernandez, 8, of Palmdale, Calif., died after years of abuse from his mother and her boyfriend. Four social workers charged in connection with his death had charged against them dismissed Thursday. 

Gabriel Fernandez, 8, of Palmdale, Calif., died after years of abuse from his mother and her boyfriend. Four social workers charged in connection with his death had charged against them dismissed Thursday. 

The case was the subject of a six-part Netflix documentary released earlier this year titled "The Trials of Gabriel Fernandez."

Fernandez's death sparked a barrage of criticism of the county Department of Children and Family Services and served as a warning to child protective workers everywhere who might ignore signs of child abuse.

"We respect the court’s decision," a DCFS statement said. "Over the years, the Los Angeles County Department of Children and Family Services has taken significant steps to mitigate risk and improve our capacity countywide in order to best serve vulnerable children and families and as a department we remain committed to ensuring that reform continues."

Pearl Fernandez was sentenced to life in prison in 2018 and Aguirre received the death penalty.

In January, the 2nd District Court of Appeal ruled that a lower court should have granted a defense motion to dismiss the case against the social workers. The judge, George Lomeli, called the boy's death "foreseeable" when he denied the motion.

The appellate ruling said the social workers "never had the requisite duty to control the abusers and did not have care or custody of Gabriel."

CLICK HERE TO GET THE FOX NEWS APP

In a dissenting opinion, Associate Justice Victoria Gerrard Chaney agreed that the four should not be charged with child neglect but instead as public officers.

"Allowing a social worker to evade liability for falsifying a public document would incentivize social workers to put their own interests in avoiding liability for their misdeeds above the purpose of the state’s child welfare statutory scheme, which is child safety," she wrote.