Image copyright AP

Police outside the US city of Baltimore shot and killed a woman holed up with a five-year-old boy.

Korryn Gaines, 23, was armed with a shotgun and due to be arrested for an outstanding traffic violation at the time.

Police said she refused to co-operate and opened fire when they tried to enter her apartment.

The boy, who may have been her son, was also shot during the exchange, but is in a stable condition in hospital.

Police said Gaines threatened to kill them. It was unclear whether the child was wounded by the police or Gaines.

The incident lasted hours, with Gaines and Baltimore County police officers locked in a standoff. News of her death has gone viral on social media.

Image copyright Twitter

The shooting began after police went to serve arrest warrants on her and a man in the suburb of Randallstown. Gaines was wanted for failing to appear in court for traffic stop charges dating to March. The man was wanted for assault, but was not found at the scene.

"We discharged one round at her," Police Chief James Johnson told reporters at news conference. "In return, she fired several rounds back at us. We fired again at her, striking and killing her."

Gaines was hit by more than one bullet and pronounced dead at the scene. The boy in the apartment was shot in a limb.

He was cradled in her arms when officers finally entered the room.

The officers involved in the shooting have been placed on administrative leave. Baltimore's police started using body cameras a few weeks ago, but the department has not confirmed if those involved were wearing them.

Extracts from Twitter debate

Image copyright Twitter

Image copyright Twitter

Image copyright Twitter

Image copyright Twitter

"We should all be cautious to believe the first version of events offered by police when they use lethal force," said Shaun King, a civil rights activist in an article for New York Daily News. "If law enforcement officers make a huge mistake, they will rarely come out and admit such a thing on the day of the event."

There has been a surge of outrage and questioning on social media in the wake of the incident.

"My niece is a good person; I never knew her to be a rowdy person," said Jerome Barnett, Gaines' uncle in an interview with the Baltimore Sun immediately after the incident. "She was smart and very respectful."