A 40-year-old man was charged Thursday with three felony assault counts for allegedly shooting up his south Minneapolis apartment building last weekend, prompting a standoff with police before an officer shot and disarmed him.

According to the criminal complaint, Nathan Mellstrom Matz fired numerous shots with an AK-47 rifle sometime before 4:30 a.m. Saturday at the apartment building, in the 4000 block of Minnehaha Avenue in the Longfellow community. Several 911 calls summoned the police, who evacuated residents before finding Matz in a stairwell holding the rifle.

An officer gave Matz a minute and 20 seconds to drop the gun before firing a single shot at him. The suspect was taken by ambulance to the hospital, where he was expected to survive his wound. No one else was injured in the episode.

One resident told police he heard gunfire, stepped out in the hall and ran back into his apartment when he saw the gunman down the hall, who fired and nearly hit him. Another resident said he heard gunshots through his floor and found bullet holes there. A homeowner across the street said her house was hit by bullets and that she believed it was targeted during the shooting.

Matz is charged with three counts of second-degree assault with a dangerous weapon, but prosecutors may seek an aggravated sentence because, among other things, the shooting occurred in a densely populated area.