A police officer and a civilian also died in a gun battle that prompted a citywide shelter-in-place alert.