ORLANDO, Fla. — A man who police say shot an officer before barricading himself in a Florida apartment killed the four children he had been holding hostage before killing himself, police said Monday.

Orlando police Chief John Mina said at a news 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 a telephone to Lindsey, whose own phone had poor service, and saw that one of the children had been killed. Authorities then entered the apartment hoping to rescue the others at around 9 p.m., but all were found dead.

The children's ages ranged from 1 to 11, Mina said.

Orlando Police Chief John Mina. John Raoux / AP

Officers had earlier responded to a domestic violence report and were fired upon, police said. Officer Kevin Valencia was shot and was in currently critical condition, they said. He is is expected to survive, Mina said. One officer was able to return fire.

Valencia, who is in his late twenties, has been with the police department since 2016, Mina said.

Court record shows 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 The Orlando 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.