Korryn Gaines recorded video of her standoff with Baltimore County police officers on August 1 and posted it on social media. Police say Gaines, a 23-year-old black woman, pointed a gun at officers and threatened to kill them before they shot and killed her. Officers had arrived at her apartment to serve warrants. (Instagram @shesyourmajesty)

Korryn Gaines recorded video of her standoff with Baltimore County police officers on August 1 and posted it on social media. Police say Gaines, a 23-year-old black woman, pointed a gun at officers and threatened to kill them before they shot and killed her. Officers had arrived at her apartment to serve warrants. (Instagram @shesyourmajesty)

Before she was killed and her 5-year-old son injured in a shootout with Baltimore County police, Korryn Gaines was live-streaming the standoff to the Internet. Her social-media followers, police said, were encouraging her not to give in.

She did not. After repeatedly pointing a shotgun at officers standing in the hallway of her Randallstown home Monday over hours of negotiation, police said, Gaines told them to retreat or die.

“If you don’t leave, I’m going to kill you. I’m going to kill you,” she said at about 3 p.m., according to Baltimore County Police Chief James W. Johnson at a news conference Tuesday.

Police said they fired a shot, and Gaines responded with a barrage of gunfire. They shot three more times. Gaines was killed. Her son, hit by a bullet or shrapnel, is still in the hospital.

Amid the negotiations, police authorities successfully petitioned Facebook to disable the 23-year-old’s accounts, which took about an hour to take effect.

Police arrived at Gaines’s home that morning to serve an outstanding warrant from another encounter she had recorded and shown online: a March traffic stop that ended in her being charged with disorderly conduct and resisting arrest. Police also had a warrant for her boyfriend, Kareem Kiean Courtney, 39, who was charged with second-degree assault in a domestic incident involving Gaines.

No one answered the door, the chief said in recounting events. Courtney soon came out of the residence with a younger child and was arrested on the assault warrant. He was later released on his own recognizance.

But Gaines refused to leave, police officials said. When officers entered using a landlord’s key, they said, Gaines was sitting on the floor pointing a shotgun at them, and her son was nearby.

Police retreated to the hallway and began an “hours-long dialogue” with Gaines, Johnson said. Trained negotiators, mental health counselors and Gaines’s father all were summoned to talk her out of the apartment.

People discussed the incident on Twitter, debating whether police acted appropriately when faced with an armed woman who threatened officers while her child was nearby. Some said it seemed that police had no choice; others questioned whether the official account was accurate.

“There were times when we thought this would come to a peaceful resolution, closure,” Johnson said. “There were other times she was highly agitated. The entire time throughout the afternoon she repeatedly pointed the weapon at our personnel.”

Baltimore County Police held a news conference on August 1 about the fatal shooting of 23-year-old Korryn Gaines, a black woman killed by police in Randallstown. Officers were trying to serve warrants at the apartment when they said Gaines pointed a gun at them and threatened to kill them during an hours-long standoff. A five-year-old boy was taken to the hospital with a gunshot wound. (Baltimore County Police)

Gaines legally purchased the Mossberg 12-gauge shotgun with a pistol grip last year, police said.

Police could not say whether the child was hit by a bullet or shrapnel from shots fired by authorities or by his mother. They also said they could not say exactly where the boy was when shots were fired. “We know the child, as a 5-year-old would, was moving about,” Johnson said.

Police did not record the negotiations. The department launched a body camera program in July, but police involved in this shooting had not been trained or issued cameras, said county police spokeswoman Elise Armacost. Since the program launched, only about 40 officers out of the 1,900-member force have been outfitted with the devices, she said.

Johnson said Gaines had “anti-government views” but it is unclear if she was part of any specific movement.

Her aunt, Shannon McGee-Gaines, said in an interview Tuesday that an inaccurate portrait was emerging of her niece but that she did not feel she was in a position to share details.

“She was intelligent, strong, determined, beautiful. She was a dedicated mother, an awesome friend. She was determined to enlighten people. There’s not enough accolades I can give her,” McGee-Gaines said. “There’s a lot that people don’t know.”

Gaines had a history of problems with anger and impulsive behavior, according to assessments from a doctor included in a lawsuit Gaines filed in 2012 against the owner of two Baltimore rental homes she had lived in as a child.

Her suit alleged “a sea of lead” paint made her ill.

A doctor who examined Gaines found that she continued to display “signs of neurocognitive impairment,” and “lost significant IQ points as a result of that exposure.”

On social media, Gaines frequently posted messages highlighting police shootings of unarmed black people across the country, which have provoked massive protests in recent weeks.

She threatened a militant response.

“They can try to come get it they gon leave with more Lead than they poisoned me wit,” one message on her Instagram page reads.

In a video posted about two weeks ago, Gaines is shown loading a shotgun. “They threw me a charge too late,” she wrote. “Let’s dance, i got some rhythm.”

According to a police report from the March stop, which the department released after the shooting, Gaines was stopped when an officer saw that in place of a license plate she had a piece of cardboard on her vehicle. The cardboard declared, “Any Government official who compromises this pursuit to happiness and right to travel, will be criminally responsible and fined, as this is a natural right and freedom.”

Gaines refused to give police her license and registration at the traffic stop, according to the report, saying they had no right to stop her. Police say she told them that if they wanted her to leave the car, they would have to “murder” her, according to the report.

Two children were in the car, according to the report. In one video she posted online, an officer is seen moving a child off Gaines’s lap while another officer grabs her arm.

Gaines was ultimately removed from the car and arrested, suffering a minor cut on her finger, the report states.

While waiting for a paramedic to arrive, Gaines shouted to her son to fight and bite the police, according to the police report.

After the shooting, police also released a report showing that officers had been called to Gaines’s apartment on June 28 for a report of a domestic dispute between Courtney and Gaines. The couple allegedly was having an argument that led to a physical confrontation. Gaines told police that Courtney grabbed a chair and “attempted to strike her with it,” according to the report.

Gaines and Courtney have been together for about three years and living together for about three months, according to the report.

Sheldon Greenberg, an expert on police protocol at Johns Hopkins University, said decisions during hostage standoffs focus on the threat posed by the person with the gun, not the age of the hostages.

“The fact that it’s a small child or someone elderly, from the point of view of looking at it in the aftermath, is emotional,” Greenberg said. “A hostage negotiator may use discussion of the child in a negotiation. But at the point of a police action, them having to wrestle the person down or even shoot the person, that’s after all considerations have been made.”

He said that if a child is separate from the person with the gun, police may try to coax him or her to safety. But if the child is with the armed suspect, trying to address him or her directly could “exacerbate the situation.”

Gaines is one of 564 people to be fatally shot by police this year; 27 were women. Nine of those women, like Gaines, were black.

Armacost said police “exercised extreme patience” and always tried to avoid death.

But if someone points a gun at officers “it very well many not end well, and that is the situation we had in this case,” the police spokeswoman said.“If the same situation evolved with a person of any race or ethnicity . . . we would have the same outcome.”

Dana Hedgpeth, Peter Hermann and Jennifer Jenkins contributed to this report.