Facebook granted an emergency request from Maryland police to take offline social media accounts belonging to an armed woman during a five-hour stand-off that turned deadly.

Baltimore County Police officers shot and killed Korryn Gaines, 23, after she barricaded herself inside her Randallstown flat with her five-year-old son and pointed a shotgun at officers attempting to serve an arrest warrant.

Police Chief Jim Johnson said the department made the emergency request to have Gaines' social media accounts suspended after she posted videos online showing the stand-off.

He said people who saw the postings responded by encouraging her to not to comply with police.

Videos posted on Facebook and Instagram appeared to show Gaines, who was black, talking with police in the doorway of her flat and to her son during the stand-off.

In one, she asks her son what the police are trying to do.

"They trying to kill us," the boy says.

"Do you want to go out there?"

"No," he says.

The stand-off on Monday began after three officers went to Gaines' home to serve arrest warrants on her and her boyfriend, Kareem Courtney, 39, according to police.

He left the flat with a one-year-old boy before the stand-off and was arrested.

Gaines' warrant stemmed from charges during a March 10 traffic stop, including disorderly conduct and resisting arrest.

Police said she was armed with a 12-gauge pistol grip shotgun that was legally purchased last year and towards the end of the negotiations pointed it directly at an officer and said: "If you don't leave, I'm going to kill you."

An officer shot at her and Gaines fired two shots, but missed the officers, who returned fire and killed her, police said.

Gaines also posted videos from the March traffic stop on her Instagram account.

Police said she was pulled over because instead of a number plate, she had a cardboard tag that said: "Any government official who compromises this pursuit of happiness and right to travel will be held criminally responsible and fined, as this is a natural right and freedom."

During the stop, she said officers were trying to "steal her car and they would have to "murder" her to get her out of the vehicle, according to court documents.

Officers said she had to be pulled from the car and repeatedly yelled "record this" as a crowd of people gathered while police were arresting her.

Facebook has restored Gaines' social media pages, but two videos that violated its standards have been blocked from public view.

According to the tech company's policies, requests from law enforcement to suspend accounts may be granted in cases where there is a substantial risk of harm.

The police chief said county police submitted a de-activation request because there was a barricade involving someone with a gun, and a child was present.

Facebook received roughly 855 requests for emergency disclosures of information to government agencies due to the threat of harm or violence between July and December 2015. About 73% of those requests were granted.

The boy was injured and is in good condition in hospital. Police are not sure whether he was hit by gunfire or shrapnel.

Gaines' boyfriend is charged with second-degree assault, which stems from a fight with Gaines, police said.

The department did not release the names or races of the officers involved, who were placed on administrative leave.

The department is bringing body cameras online but none of the officers had one.

Gaines' uncle Jerome Barnett told The Baltimore Sun that she "was feisty, but she was smart and she was respectful".

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.