A man accused of firing random shots inside a Walton County subdivision Wednesday afternoon was taken to a hospital for evaluation, officials said.

The Morgans Landing subdivision in Monroe was locked down by sheriff’s office deputies about 4 p.m., when a man in his early 40s fired shots in the neighborhood. Deputies said between 40 and 50 rounds were fired at deputies, SWAT members and a helicopter.

David Cook was taken down and arrested about 5:30 p.m.

He is accused of the crime, but deputies said he was suffering from depression and have not yet filed formal charges.

Cook has no criminal history, the sheriff’s office said.

He told authorities he wanted to commit suicide by cop.