Two San Diego police officers were shot Saturday evening after a gunman wearing body armor barricaded himself in an apartment and fired through the walls.

One of the officers is reportedly hospitalized with life-threatening injuries after taking a gunshot wound to the chest. The other officer was hit in a shoulder but was expected to be OK, reported Andrew Lumia of FOX 5 San Diego.

Both officers are both male, with three and 18 years of experience. Their names have not been released.

After a standoff of about two hours, the suspect was pronounced dead just before 1 a.m. Sunday local time, after police sent in a robot and a police dog to check the apartment, the San Diego Union-Tribune reported.

A camera attached to the robot spotted the suspect lying on the floor with apparent head trauma. Authorites then sent in the dog, which bit the suspect on a leg but received no response.

It was unclear if the suspect had been shot in the head by police, or if the wound was self-inflicted, FOX 5's Lumia reported.

Police later conducted welfare checks of nearby apartment units before giving an all clear.

The situation drew multiple police vehicles to the Rolando-area apartment complex where the gunman, reportedly in his 30s, barricaded himself inside, the Union-Tribune reported.

Authorities blocked off surrounding streets and evacuated tenants.

Around 11:20 p.m., a SWAT team had taken a suspect into custody, but it was later confirmed that the suspect was not the shooter.

No other injuries were reported.

Earlier in the day, hundreds of demonstrators marched to San Diego's Otay Mesa Detention Center to protest the Trump administration's immigration policies. But it was unknown if the standoff situation had any connection to the protests.

The demonstration was largely without incident. But by evening, police had arrested six people for unlawful assembly and blocking access to a road, FOX 5 reported.