Heartbroken mourners gathered Thursday to say a final goodbye to the 8-year-old Long Island boy who police say was slain by his NYPD cop father and the officer’s fiancée.

Roughly 100 family members, friends and even strangers touched by the horrific tragedy showed up at St. Elizabeth Church in Melville for the funeral service of Thomas Valva.

Thomas, who had autism, died of hypothermia after authorities found him unresponsive at his Center Moriches home Jan. 17.

Police veteran Michael Valva, 40, the boy’s dad, and Valva’s fiancée, Angela Pollina, 42, were charged with second-degree murder in Thomas’ death after cops say the couple tortured the child, subjecting him to “freezing temperatures” in their unheated garage overnight when temperatures outside plunged to 19 degrees.

Ahead of the service, the boy’s grieving biological mother, Justyna Zubko-Valva, bent down inside the church alongside her surviving sons, Anthony, 10, and Andrew, 6, to kiss the white casket holding Thomas’ body.

Bishop Andrzej Zglejszewski then delivered a moving homily in which he told mourners how pint-sized Thomas became “a giant” in recent days.

“Thomas was just a little boy. He just wanted to be loved, wanted to be hugged, wanted to be cherished, he wanted to be wanted. He was a gift,” said Zglejszewski, who had baptized the youngster.

“Thomas, little boy, thank you for the gift of you. Thank you for the gift of life. I am sorry that it was way too short for you. But I thank you for your beautiful life,” he said.

The bishop declared that “our system” had “failed” Thomas as he alluded to how Zubko-Valva has said that authorities ignored her repeated claims that her children were being abused.

“Our legal and social system failed him,” said Zglejszewski. “I am sorry to say that somehow we failed him.”

“Do you know why?” he asked. “Because we create systems. We choose our elected officials. We make our agencies that are supposed to take care of life — take care of children. What happened? What went wrong?”

Zubko-Valva, who says she “unlawfully” lost custody of Thomas and her two other sons, in 2017 amid a bitter divorce battle with Valva, read from the Bible, the book of Revelation, during the service.

“In my father’s house there are many dwelling places…Where I am going you know the way,” she read.

Her son, Anthony, also read from the Bible.

“Good is the lord to the one who waits for him,” the 10-year-old read.

Mourners inside the church included Suffolk County Executive Steve Bellone, who this week announced that the county is launching an internal investigation into how its Department of Social Services handled the case involving Thomas.

Doreen Triola was among the mourners who did not know the victim, but showed up at the funeral anyway to pay respects.

The tragic case “certainly has to be investigated and investigated thoroughly, and if there was any wrongdoing … people need to be held responsible,” Triola said.

Thomas will be buried at the Saint Charles Cemetery in East Farmingdale.