ORLANDO, Fla. (AP) – A man who police say shot an officer before barricading himself in an Orlando apartment killed the four children he had been holding hostage before killing himself, police said Monday.

Orlando police Chief John Mina said at a press conference just before midnight that the suspect, who was identified as 35-year-old Gary Wayne Lindsey Jr., was found dead in a closet when officers entered the apartment nearly 24 hours after the standoff began.

Mina said officers tried to offer one of their phones to Lindsey, whose phone had spotty service, and saw that one of the children had been killed. Authorities entered the apartment around 9 p.m. hoping to rescue the others but all were found dead.

The children with Lindsey ranged in age from 1 to 11, Mina said. The Orlando Sentinel reports two of them were Lindsey’s children and two belonged to his girlfriend, who called police Sunday.

Officers responding to a domestic violence report were fired upon, police said. Officer Kevin Valencia was shot and was in critical condition but is expected to survive, Mina said Monday. One officer was able to return fire, the police chief said.

Valencia is in his late 20s and has been with the police department since 2016, Mina said.

Court records show Lindsey, 35, had an extensive criminal history involving arson, battery and theft. He was on probation for several charges including arson.

Judy Pepper, who lives in the apartment complex, told the Sentinel that she had fallen asleep on the couch after watching a Sunday night baseball game on television when she heard four loud gunshots.

“It just went, ‘Pop. Pop. Pop. Pop,'” Pepper said.

She looked out the window and saw three people carrying a police officer onto the grass. She said other officers arrived, cut open his shirt and appeared to be putting bandages on his neck. Then, they put him in a patrol car and sped away.

“Hell, yes, I was absolutely terrified,” she said.

Officers evacuated other residents of the complex in the middle of the night. Some were milling around nearby restaurant parking lots Monday morning, still wearing pajamas. They were later taken to a hotel.

The standoff also disrupted the routines of residents who lived in neighboring apartment communities. About five blocks from the apartment, two police squad cars blocked the entrance to the street. Residents of the neighboring apartment complexes had to show identification and be escorted by the police. Several firetrucks lined the road.