FALMOUTH >> The armed Falmouth man who held police at bay during a seven-hour standoff at a Mashpee store has been ordered to undergo a mental health evaluation after pleading not guilty to several charges.

Patrick Perkins, 41, was arraigned Thursday on charges of discharging a firearm within 500 feet of a building, assault with a dangerous weapon, and being an intoxicated with a firearm in connection with the standoff Wednesday afternoon.

Police responded to the store after getting reports that Perkins was despondent over a separation with his wife and made threats to kill himself. He surrendered voluntarily and no one was harmed.

The Cape Cod Times reports that his lawyer says Perkins only wanted to harm himself and now wants help.