BREWSTER, Mass. (AP) — A 29-year Brewster man described as mentally ill has pleaded not guilty to setting a fire that destroyed a local church.

The Cape Cod Times reports a judge ordered a competency examination for Adam Finnegan at his arraignment Monday in Orleans District Court. Finnegan is charged with one count of burning a building. The three-alarm blaze early Friday destroyed the Cape Cod Bible Alliance Church.

Judge Brian Merrick ruled Finnegan's ability to understand the alleged crime and the court proceedings will need to be evaluated.

A Brewster police report said Finnegan told officers he suffered from depression and anxiety and his mother told investigators he had set small several fires at home.

Finnegan's parents said in a statement to the Times that their son is mentally ill and the burning of the church is "heartbreaking."

Join our Newsletter for the latest news right to your inbox