A woman was shot and killed on Monday when an hours-long standoff at a Maryland apartment ended in an exchange of gunfire that also left a 5-year-old boy wounded.

Authorities said Korryn Shandawn Gaines, 23, had barricaded herself in the apartment and repeatedly threatened Baltimore County Police officers with a long gun.

The boy was transported to a hospital with non-life threatening injuries and is expected to survive. Authorities do not currently know whether the round was fired by Gaines or police.

“We are of course extremely upset at an event like this,” police spokeswoman Elise Armacost said at press conference. “We do not like to be in a position of having to use lethal force, but this was a situation where our officers exercised patience for hours and hours.”

She added: “We are very relieved the child was not seriously injured.”

The incident began at 9:20 a.m. ET when three police officers arrived at the apartment in Randallstown, Baltimore County Police Chief James Johnson told reporters.

The officers intended to serve arrest warrants on Gaines and a man. Gaines was wanted on a bench warrant for failing to appear in court on charges related to previous cases of disorderly conduct and resisting arrest following a traffic stop in March “and numerous other traffic offences,” according to Johnson. The man, who has yet to be identified, was wanted for assault.

Officers repeatedly knocked on the suspects’ apartment door, identifying themselves as police and announcing their intent to serve arrest warrants, Johnson said. The officers said they did not receive a response, but could hear the sounds of a man, woman and crying child from inside the apartment. After waiting five to 10 minutes, the officers obtained a key to enter from the landlord.

When an officer opened the door, he allegedly saw Gaines sitting on the floor pointing a long gun at him. Police retreated to the hallway and called for tactical personnel.

At this point, the male suspect attempted to flee the apartment with a 1-year-old child but was apprehended, Johnson said. Other residents were evacuated from the building.

For the next several hours, officers attempted to negotiate with Gaines who remained inside the apartment with the older boy. Throughout this barricade, the woman repeatedly pointed her long gun at officers and made threatening remarks, Armacost said.

According to Armacost, at 3 p.m. Gaines directly pointed the gun at a tactical officer and said: “If you don’t leave, I’m going to kill you.”

An officer fired his weapon, with the woman returning two rounds, Johnson said.

Police then fired again at the woman, striking her multiple times and killing her. The five-year-old was also shot during the exchange of gunfire.

Authorities said the officers involved in the incident will be placed on administrative leave. An investigation is ongoing.