CHICAGO –Four people were killed – including a Chicago police officer, ER doctor, pharmacy resident — Monday afternoon in a shooting at Mercy Hospital on the city’s Near South Side.

The gunman, identified as Juan Lopez, 32, was also killed.

The known victims were identified as emergency room surgeon Dr. Tamara O’Neal, Chicago police officer Samuel Jimenez, and 25-year-old pharmacy resident Dayna Less.

Gunfire erupted inside and outside the hospital after 3 p.m. at the main hospital, located at South Michigan Avenue and West 25th Street. The gunman first opened fire outside the hospital, shooting his ex-fiancée, Dr. Tamara O’Neal after a domestic dispute.

The suspect then fired at police arriving at the scene before running into the hospital, where he engaged in a gun battle with officers.

Mercy Hospital held its first-ever active shooter drill just weeks before the shooting Monday that left four people dead – a move that might have prevented even worse carnage, hospital officials said.

Michael Davenport, Mercy’s chief medical officer, said the hospital held its first active-shooter drill just weeks ago. Some, but not all, hospital employees participated. The drill was a follow-up on Internet and classroom instruction for employees, Davenport said.

He said it appeared hospital employees executed the “run, hide, fight” instruction.

“Never in our wildest imagination would we ever think that we would have to experience the day we have,” Davenport said. “It is our inclination, I can speak for myself, you don’t feel well when you’re hiding. You want to open up a door and you want to see what’s going on and you want to help. But everyone did what they were trained to do.”