STOCKTON, Calif. (KTXL) — Stockton police said a man they arrested Wednesday night had shot at officers and tried to escape. 

On Thursday, police identified the suspect as 29-year-old Robert Legg. 

Police said they tried to contact Legg on Wednesday for warrants, but he shot at them. Legg allegedly ran from them and hid in an “enclosure.” 

Dozens of officers then went to the area of West Lane and Bradford Street. Residents were asked to shelter in place as they searched the area.

According to police, Legg refused to leave the enclosure and was arrested near Sierra Nevada Street and Walnut Street after a struggle. 

Police said he was arrested on suspicion of resisting arrest, assault with a deadly weapon and for warrants.