MANCHESTER, N.H. — New Hampshire’s attorney general says a YWCA where a father shot his 9-year-old son to death during a supervised weekend visit had used a metal detector on the man in the past but did not use it Sunday.

WMUR-TV reported that the handheld metal detector wasn’t used on Muni Savyon but it wasn’t clear why. Police say Savyon shot his son before taking his own life. The YWCA said it is devastated by the “senseless act of violence.”

The president of the YWCA said that someone determined to carry out violence will do so regardless of security measures.

Monica Zulauf, the center’s president, wouldn’t discuss details of the case, but she said the center does as much as it reasonably can to provide a safe place for visits.

Zulauf said that beyond security measures, the focus should be on urging the public to intervene when they see or hear something troubling.

The YWCA was closed Monday and said it was working with police and the attorney general’s office.

Senior Assistant Attorney General Jeffery Strelzin said that when the YWCA has had the money in the past, it has hired police officers to be in the building to provide security.

An adult supervisor was present when Savyon, 54, of Manchester, took out a handgun and shot Joshua Savyon of Amherst before shooting himself around 10 a.m., the attorney general’s office said.

Sayvon, a software engineer, sent an email to a friend suggesting he was suicidal before the shootings, said Rabbi Levi Krinsky of Chabad Lubavitch in Manchester. Krinsky said Savyon had been depressed after recently returning from his brother’s funeral in Israel but he had seen him last week and had no concerns he would harm himself or someone else.

“What would provoke him to take his life and his son’s life? I don’t think anyone can figure that out,” said Krinsky, who said Savyon attended synagogue occasionally. “My heart goes out to the family.”

On Sundays, the YWCA is open for supervised child visitation and custody exchanges. Krinsky said the man and the boy’s mother shared custody of the boy after parting ways years ago. The couple’s marital status wasn’t clear; Krinsky said the couple were divorced, but law enforcement officials said the two were separated.

Law enforcement officials said the relationship had been contentious at times and Muni Savyon had previously threatened to kill himself, his son’s mother and their son.

But Ellen Savyon Vig, who was once married to Muni Savyon and had remained friends with him after their 1997 divorce, described him as a kind-hearted person. She said he was especially close to his brother and he loved his son, trying to give him varied experiences.

“He was nonviolent. He would try to help anyone he could. He was a really nice guy,” she said from her home in North Billerica, Mass.

Savyon was active in Libertarian causes, Vig said, and was a twice-defeated candidate for the New Hampshire Legislature, most recently in February.

“Please keep the Savyon family in your thoughts and prayers as they cope with the unimaginable,” Rep. Peter King, who easily beat Savyon in a special election for the New Hampshire House, said from his Twitter account.

Born in Israel, Savyon was a naturalized citizen who lived in several Western states before coming to New England, where he worked as a software engineer, Vig said.

Others were inside the YWCA building when the shots were fired partway through the one-hour visitation. The counselor who was present at the time managed to escape unarmed, officials said.

Autopsies were scheduled for Monday.

Krinsky said he had no idea that Savyon was capable of violence, much less harming his own son. “We have to be more and more alert to mental illness and people who’re depressed,” he said.