A Fitzwilliam man arrested Friday after a nearly 16-hour standoff with police will remain in jail for now, a judge ruled Monday, but may be released on admission to the county’s mental health court.

John J. Riley, 54, is charged with a felony count of domestic violence. The charge alleges he brandished a machete in a threatening manner around a family member.

A plea of not guilty was entered at Monday’s arraignment in Cheshire County Superior Court, during which lawyers called in and Riley appeared via video from the Cheshire County jail in Keene.

N.H. State Police said in a news release Saturday that state troopers and local police were called to Riley’s home on Templeton Turnpike around 6:30 a.m. Friday for a report that he had threatened family members.

When initial efforts to reach him failed, a SWAT team was called in, according to the release. Police said Riley surrendered without incident after more than 15 hours.

According to an affidavit written by N.H. State Police Trooper Kevin P. Pratt, a family member living with Riley said he had a history of “mild” depression, but she had not seen him engage in threatening or violent beha-vior before last week.

This family member told police that Riley’s mental state had appeared to worsen earlier in the week, to the point that he made paranoid statements and threatened to harm himself, according to the affidavit. He agreed to admit himself into Cheshire Medical Center but walked out soon after getting to the hospital, the trooper wrote.

The following morning, Friday, two family members went to check on Riley in his bedroom, where they found him “holding a hammer, a machete, a knife, a can of WD40, and a lighter,” Pratt wrote. He “threatened to ‘blow up the house’ and exhibited manic behavior,” though one of his relatives eventually persuaded him to lower the machete, according to the affidavit.

The family members left the house and called police, according to the affidavit.

During Monday’s arraignment, one of those relatives told Judge David W. Ruoff that they had removed all weapons from the house after Friday’s incident and were willing to have Riley resume living there, once he has stabilized and been evaluated.

Ruoff said Riley can be released from jail if he is admitted to the Cheshire County Beha-vioral Health Court — an alternative court program for those with mental health disorders — and a doctor reviews his medications.

“The intent here really is to make sure you’re stable before you’re released,” Ruoff said.

Paul Cuno-Booth can be reached at 352-1234, extension 1409, or pbooth@keenesentinel.com. Follow him on Twitter @PCunoBoothKS