Three people were killed by the gunman, officials said, and two others were wounded.
Perez was confronted by Cincinnati police officers inside of the building, officials said, and a shootout commenced.
The gunman was killed in the incident, police said, although it's unclear if he was shot by police or his own hand.
No officers were injured in the incident, and Perez's motive remains unclear.
"This could have been a bloodbath beyond imagination," Hamilton County Prosecutor Joe Deters said.
Deters added that Perez had several hundred rounds of ammunition on him, and praised Cincinnati police officers for their response.
Deters added that Perez had several hundred rounds of ammunition on him, and praised Cincinnati police officers for their response. "It could have been a lot worse. People in this town should just thank a cop when they see them, because what they did today was just unbelievable,” Deters said.
Deters said that several officers fired through the glass of the building in an attempt to thwart an active shooter situation.