Updated

A man wearing body armor pointed an assault rifle at two police officers in a California Starbucks, only to have the weapon malfunction before he fled and was shot by the officers nearby, police said Monday.

Vallejo Police Chief Andrew Bidou called it an "attempted assassination" of the two officers, who were on break when the confrontation occurred.

The officers were caught off-guard and "were ambushed by somebody who has superior firepower," the chief said.

It marked the latest attack on police across the country, including two incidents in California in recent weeks that left a total of three law enforcement officers dead.

Police in Vallejo said Adam Powell, 41, had passed by the Starbucks six minutes earlier, apparently planning the attack.

Video from a nearby security camera showed a man walking up to the coffee shop and then sprinting away seconds later, with at least one officer chasing him.

Police said Powell appeared to keep trying to clear his weapon as he ran. Officers shot him three times about 100 feet from the Starbucks.

Resident Jazmin Addison said she heard more than a dozen shots at the corner outside her home. Addison later looked out to see a man lying on the ground, surrounded by officers.

Powell was in critical condition but stable on Monday. Police Lt. Jeff Bassett said authorities expect to arraign him within the next few days.

Police said Powell's weapon never fired. A photo provided by police showed an assault rifle bearing wear marks and duct tape. Bassett said the gun was operable except for the jam.

The man also carried a loaded handgun, police said. They described his body armor as "police-style."

Six hours before that confrontation, police responding to a shooting in Suisun City, 20 miles away, found Powell's 2-year-old son critically wounded in a family home. Powell was not there when police arrived, and other relatives told police the child had accidentally shot himself.

Police want to question Powell about the boy's shooting and about the confrontation with police in Vallejo.

Police said they did not know if Powell, who had a felony record of robbery and drug offenses, had expressed any anger toward police.

The Vallejo shooting came amid growing national attention to police shootings of suspects, and to attacks on police.

On Tuesday, a memorial service will honor two officers killed in Palm Springs, California, while responding to a domestic disturbance at the home of an ex-convict.

The Palm Springs shooting occurred just three days after a Los Angeles County sheriff's sergeant was shot and killed in the high desert town of Lancaster while answering a burglary call.

"Officers I think around the country are at a heightened state of alert now," the Vallejo chief said.