ORLANDO, Fla. – A man killed himself and the four children whom he had taken as hostages, to end a standoff in Orlando, police said Monday night.

The children died of apparent gunshot wounds, said Chief John Mina, of the Orlando Police Department, in a news conference.

Police had been in contact with the suspect, Gary Lindsey Jr., throughout the day, officials said.

Authorities had direct and indirect contact with Lindsey as late as 8:30 p.m. or 9 p.m., Mina told reporters.

It’s not clear when exactly he killed the children, Mina said. Officials will investigate that.

Communication with Lindsey hadn't been good, based on his cellphone settings. When officials tried to give him another phone, they noticed one child was dead, Mina said.

When SWAT officers proceeded to enter the home where Lindsey was barricaded, at about 9 p.m., they found him in a closet, already deceased.

About 60 people with the Orange County Sheriff’s Office assisted with the investigation, Sheriff Jerry Demings said. A bomb squad also came in to help.

The SWAT officers had been working on the investigation in the heat all day long, which is why sheriff’s officials were called in for reinforcement. Agencies across the state also offered assistance.

Late Sunday, an Orlando police officer suffered a "very serious and significant injury" when he was shot while responding to a domestic violence dispute at an apartment complex.

Orlando police swarmed the Westbrook Apartments on Eaglesmere Drive off Kirkman Road near Universal Orlando, and the standoff ensued. It lasted about 23 hours. Lindsay barricaded himself with the four children, whose ages were 1, 6, 10 and 11, Mina said.

Lindsey was accused of shooting Officer Kevin Valencia.

Valencia, who is in his late 20s, underwent surgery and is expected to survive.

On Monday, he was listed in critical condition. Valencia has been with the agency for less than two years.

According to Mina, the situation started when Lindsey's girlfriend called police, met officers near the complex and said her boyfriend had beaten her. As officers made contact with the man outside the apartment, gunfire was exchanged and Valencia was struck, Mina said.

Two of the children held hostage were Lindsay's, and two were his girlfriend's, police said.

A couple who lives in a nearby apartment said they heard police say, "Open the door," before four shots were fired.

"We're hoping for prayers from our community for our officer's full recovery," Mina said. "It’s hard. It’s very traumatic when one of your officers is shot in the line of duty."

At least one OPD officer fired at Lindsey, but it wasn't immediately known if he was shot, Mina said.

[PHOTOS: OPD officer shot]

"We have spoken with (Lindsey) a couple of times, and he's hung up the phone a couple of times," Mina said.

Lindsey was a convicted felon, Mina added.

Criminal records showed Lindsey was on supervised probation for an arson conviction in Volusia County.

Lindsey had been arrested four times for violating his probation in the Volusia arson charge, records show.

"My main concern is the safety and well-being of the children," Mina said earlier in the day.

Orlando police said previously that Lindsey had not threatened the hostages and they still believed this could come to a peaceful resolution.

Officers evacuated nearby units of the complex in the middle of the night, and some residents, many wearing pajamas, stood in nearby restaurant parking lots.

The Florida Department of Law Enforcement will launch an investigation, which is standard procedure in officer-involved shootings.

At 11:45 pm, OPD responded to a domestic violence call at the Westbrook Apartments on Eaglesmere Drive. The suspect fired shots, striking one of our officers. pic.twitter.com/W6lryLW7gk — Orlando Police (@OrlandoPolice) June 11, 2018

Dozens of officers at Kirkman and Windhover, in response to call. Reports of officer involved situation, where officer may be hurt. Working to confirm. #News6 crew also headed to hospital. pic.twitter.com/v7MRAeOCH2 — Sachelle Saunders (@SachelleOnAir) June 11, 2018

We’re at @orlandohealth where there is a very large presence from @OrlandoPolice. Right now we’re working to find out if an officer was injured and if it is related to a large crime scene off Kirkman Rd. pic.twitter.com/NCRod00Xtv — Mark Lehman (@MarkLehman6) June 11, 2018

The shooting took place in the same area where Orlando police Officer William Anderson was struck by a suspect's vehicle and severely injured in July 2015.

Edward Kelty, who was 17 years old at the time of the incident, was sentenced to 18 years in prison in connection with running over Anderson.

There are a number of resources available for victims of domestic abuse. The National Domestic Violence Hotline number is available 24 hours a day at 800−799−7233.

Click the link below to help stop domestic abuse.

Watch News 6 and stay withe ClickOrlando.com for updates.