San Diego police engaged in a shootout Wednesday morning with a gunman who opened fire while inside of an apartment building.

Police were responding to a domestic violence call around 9:15 a.m. in the Bankers Hill neighborhood. However, when they arrived on the scene at 2445 Brant Street, the suspect began firing a high-powered rifle at police through a closed interior door of the apartment, prompting police to exchange fire as they retreated. The gun fire continued until after 10 a.m., reports NBC San Diego.

According to Lt. Scott Wahl, the shots came "within inches" of striking the officers as they approached the man's rooftop apartment. However, no one was hurt.

Because the apartment complex is located under the San Diego International Airport's approach path, airport officials halted landings as a precaution, according to Federal Aviation Administration spokesman Ian Gregor. Ground traffic in the community was also shut down. Meanwhile, residents in the area were asked to stay inside of their homes and away from windows in the complex.

"He's shooting in all different directions," Wahl said, according to The Associated Press. "But we have him contained inside the building."

Police also said that the alleged domestic violence victim is safe.

Officers said they managed to contain the suspect, who has not been identified, in a one-bedroom apartment on the southeast side of the apartment building, Wahl said.

"This situation is rapidly evolving," he added. "They were able to use a K9 to try and clear the apartment. At some point when they were inside the apartment, rounds began to come out of a door, an interior door, nearly hitting the officers."

"I'm just on the other side of the border, they wont let me leave my apartment complex here," said resident Ryan Gray who lives nearby the incident. "It's definitely dangerous, I'd say that the police are doing their job and keeping us all safe."