MADISON TOWNSHIP, Ohio - The man killed Thursday when he ran at SWAT officers while holding a gun had threatened suicide and was just released from a hospital where he'd been treated for depression, officials said.

Benjamin Ailstock, 38, also had a criminal history that includes convictions for robbery, assault, resisting arrest and drug possession, Lake County Sheriff Daniel Dunlap said at a news conference.

A Lake County Sheriff's Office SWAT Team officer shot Ailstock at the end of a six-hour standoff outside his home in Madison Township. Ailstock refused to negotiate with SWAT officers before he charged out of the house and toward officers while holding a gun, Dunlap said.

"We certainly didn't want it to end this way, and we made our very best efforts so that it wouldn't end the way that it did," Dunlap said.

One officer fired three shots, two of which struck Ailstock in the chest and arm, Dunlap said. Madison Fire District paramedics took Ailstock to the Madison Medical Campus, where he was pronounced dead.

Investigators have not released the identity of the officer who shot Ailstock.

Ailstock has a history of being treated for depression, and he'd been released from a hospital a day before the shooting, Dunlap said.

Ailstock should not have been in possession of a gun due to his criminal history, Dunlap said. In 2012, Ailstock was sentenced to two years in prison after pleading guilty to robbery, Lake County Common Pleas Court records show.

Lake County sheriff gives update on fatal SWAT shooting. More info: http://www.cleveland.com/willoughby-hills/index.ssf/2017/04/sheriffs_office_provides_updat.html Posted by cleveland.com on Thursday, April 6, 2017

Madison Township officers went to the Hazel Avenue house late Thursday after Ailstock's wife called 911. She told police that Ailstock had been drinking, and that they'd been involved in an argument in the driveway, Dunlap said.

Ailstock's wife told police that she gathered his guns and took them out to her car. Ailstock threatened her, and she left the house to call 911.

Madison Township officers arrived at 10:30 p.m. and spoke briefly with Ailstock, who answered the door while holding a gun. Ailstock closed the door in their face and refused to come outside, Dunlap said.

The SWAT Team was later called to offer assistance. Negotiators tried to make contact with Ailstock by calling his phone and using a megaphone, but Ailstock refused to answer.

He tried to climb out of a window with a shotgun at one point during the standoff, but he dropped the gun on the ground and climbed back into the house. The SWAT officers retrieved the shotgun without incident.

The SWAT officers repeatedly told Ailstock to drop his gun when he came running out of the house, but he refused, Dunlap said. One officer fired three times when he saw Ailstock waving the gun around, Dunlap said.

Two children lived at the house with Ailstock and his wife, but they were not present for any part of the incident, Dunlap said.

No SWAT officers suffered serious injury, but two requested evaluations after the shooting, Dunlap said.

The Lake County Sheriff's Office is investigating the incident, but the Mentor Police Department's Detective Bureau will review the investigation, Dunlap said. The Lake County Prosecutor's Office will determine if the shooting was justified, he said.

If you'd like to comment on this story, visit Thursday's crime and courts comments section.

cleveland.com is a partner of the Greater Cleveland Food Bank. Every dollar buys four meals for the hungry. Click here to donate.