A man ambushed a police officer who responded to a call at a Phoenix home early Friday, shooting him several times, then rained more gunfire on other officers who tried to rescue a baby that had been placed outside.

In all, five officers were shot, including four who were wounded while trying to take the baby to safety. Four more officers were injured by shrapnel or ricocheting bullets, Phoenix Police Sgt. Andy Williams said.

Also Read | Nation must come together to end gun violence: President Biden in NYC

All were expected to survive, and the baby was unharmed, police said.

The most seriously injured officer was the first to arrive at the home, around 2:15 a.m., following a report of a woman shot. He was invited inside, Williams said.

Also Read | Gun violence rises amid pandemic in US, kills more teens and toddlers

“As he approached the doorway, the suspect ambushed him with a gun and shot him several times,” Williams said. “That officer was able to get back and get away to safety.”

Also Read | NYPD to roll out plainclothes anti-gun unit: All precinct numbers

Another man later came outside the home holding a baby in a carrier and placed it just outside the front door. He raised his hands to surrender while backing away from the house.

Other officers who responded approached the doorway, and more shots ran out. Eight officers were wounded by bullets or shrapnel, Williams said.

After a barricade situation, the suspect was found dead inside the home, and a woman at the home was critically injured, police said in a statement. They didn’t specify how the suspect died.

Also Read | All you need to know about the Michigan high school shooting

No identities were released, and police said they were still trying to learn circumstances of the incident. Detectives were gathering evidence and processing the scene Friday morning.

Also Read | Gun violence becomes increasingly common on US streets

“This is just one more example of the dangers that officers face every day keeping us and our community safe,” Williams said. “If I seem upset, I am. This is senseless. It does not need to happen and it continues to happen over and over again.”

Also Read | How active ammunition got on set is still a mystery in Alec Baldwin shooting

The neighborhood where the events unfolded has newly built homes, and the residence where the shooting happened had its second-story windows shot out.