A man attempted to shoot a woman in the stairwell of her Brooklyn apartment building Saturday afternoon, cops said.

The 30-year-old woman was walking up the stairs of her building near Bedford Avenue and Union Street in Crown Heights just after 4 p.m. when a goon approached her from behind and attempted to shoot her, but the gun jammed.

The victim ran into the apartment and locked the door behind her — but the gunman didn’t let up. He fired several more rounds into the door before fleeing, cops said.

The woman was not injured, according to police.

Just before the incident, two children were with the woman in the stairwell, but they had already gone into the apartment before the suspect appeared, cops said.

The suspect, captured on surveillance video, is between 35 and 40 years old and about six feet tall. He was last seen wearing a black waist-length jacket, a black cap, black pants and black shoes.

It was not immediately clear whether the victim and suspect knew each other.