NEW HAVEN — An 8-year-old boy was shot to death Thursday night in an incident police say may have been accidental.

Capt. Anthony Duff said units responded to a Howard Avenue residence around 10:40 p.m. Thursday on reports of a child shot.

“In a second-floor bedroom, emergency medical responders treated the child gunshot victim,” Duff said.

The boy, whose identity was not immediately released, was later pronounced dead at Yale New Haven Children’s Hospital.

“Preliminarily, the investigation reveals the shooting occurred inside the residence and the child’s injuries were a result of an accidental firearm discharge,” Duff said in an email.

“We mourn the tragic loss of such a young member of our community,” New Haven Police Chief Otoniel Reyes said. “We ask the community to join us in keeping the family in our thoughts and prayers during this time of unimaginable loss, pain and grief.”

Reyes thanked the men and women of the NHPD and all first responders for “their compassion and professionalism during such a difficult incident.”

Detectives seized a loaded handgun and a safe from the home as part of their investigation. Police did not say who owns the gun.

Superintendent of Schools Iline Tracey said she has been in touch with the police chief about the boy’s death. She said the district would reach out to the family affected.

At an “Hour of Prayer” press conference Friday, Mayor Justin Elicker spoke about the boy’s death and the universal pain of losing a child, saying that he was at the emergency room with the child’s mother Thursday.

“While there are many different ways that we need to address the many challenges that we face as a community, I can say without fear of contradiction that we can all agree on one thing — that no parent should have to bury a child. To be left with so many questions for which there may not be an answer results in the deepest pain imaginable,” said Elicker. “I think we can all understand just how difficult that is for everyone. It’s something that should never happen.”

He was hopeful those in attendance had gathered in the spirit of love and peace, hoping to send a message to the world, Elicker said.

He asked for a moment of prayer for “the nightly challenges that our community faces” and to offer a prayer for those who have lost loved ones, including children, as “those children will always be a part of our community.”

The Rev. Kelcy Steele, pastor of Varick Memorial AME Zion Church, said that “it was a very tragic event” for the city.

The 8-year-old boy, he said, would never get to “experience the joys of life.”

Police also said notification was made to the state Department of Children and Families and Yale Child Study Center, and a child study clinician responded to the hospital to speak with the family.

Anyone with information can contact the New Haven Police Department at 203-946-6304.