JOLIET, Ill. — A Joliet police officer was stabbed in the stomach early Saturday morning during a welfare check call, according to police.

Officers were first called to a home around 4 a.m. on Bevan Drive West on the report of a man seeing an unknown person in the yard, according to a news release. Officers checked and weren’t able to see anyone suspicious.

About an hour later, they were called back to the home after the man barricaded himself inside a coat closet, according to the release. Officers said they determined he was possibly in a mental health crisis and tried to talk to him through the closet door.

When officers eventually opened the door, the man, identified as Francisco Alvarez, 42, of Glendale Heights, had a large knife and stabbed an officer in her stomach, according to the release.

Officers tried to use a taser, but it was unsuccessful, and officers were able to get Alvarez into custody after a struggle.

The officer, who hasn’t been identified, was taken to a hospital and later released, according to the release.

Alvarez was taken to another hospital and is still under police watch, according to the release. He has been charged with attempted first-degree murder and aggravated battery to a police officer.

“Our officers had only milliseconds to respond to this life-threatening situation,” Joliet Police Chief Bill Evans said in a Facebook post. “I commend my officers for their attempts at de-escalating the incident and their quick reaction to this dangerous threat.”