A 21-year-old man is in custody after Albert Lea, MN, police say he shot three men Sunday, including a police officer, leading to an eight-hour standoff.

Officers were first called to the Shady Oaks apartment complex at about 2:18 a.m. after they received a report that fireworks or gunshots had been heard.

When they arrived, police say a shooter ambushed the officers by firing several rounds down from the third floor of the apartment complex to the parking lot. One of the officers was shot in the chest, and several rounds struck a squad car. The officer who was shot was wearing body armor. The officer was treated and released at a local hospital later Sunday, CBS reports.

The two other shooting victims were a 52-year-old man and a 38-year-old man. They are both expected to recover.

The suspect — who was later identified by the Minnesota Bureau of Criminal Apprehension as Devin Weiland of Albert Lea — eventually surrendered at about 11 a.m. He suffered non-life threatening shrapnel injuries, but it is unknown how or when he was hurt. He was taken to the Mayo Clinic in Rochester. He had not been charged as of Monday morning.