A Bronx woman who was being beaten and about to be knifed by her abusive boyfriend desperately pounded on a neighbor’s door and screamed for other residents’ help Sunday — only to be turned away.

The badly injured woman was only saved when cops shot her attacker as he stabbed her in front of them and refused to put down his knife, police and witnesses said.

“Help me! Please help me!’’ the 32-year-old victim screamed, according to neighbor Jaime Vittini, 29, who lives across from the troubled couple’s third-floor apartment on Sedgwick Avenue in Fordham Manor.

“She was knocking hard on my door and crying. She sounded desperate,” Vittini admitted.

But Vittini said her husband would not allow her to open the door during the 4 a.m. violence because he was afraid the other man might have a gun.

So she said she called 911 instead — as did “numerous’’ other neighbors “who heard a female screaming,” a police source said.

Vittini then watched in horror through her door as the woman was beaten. “I saw the man through the peephole. He was not talking. He was just hitting her,’’ Vittini told The Post.

“He . . . grabbed her from behind and just threw her down.”

Vittini said she saw the terrified woman flee down the stairs.

A neighbor on the first floor said he also heard the commotion and thought a woman had been shot, prompting him to not open his door for fear of running into a gunman.

“I heard the shots, but I decided to continue sleeping,” said Felix Matta, 73. “I didn’t want to get shot.”

When police arrived, they found the woman’s knife-wielding boyfriend, 34, repeatedly stabbing her in the lobby of the building and ordered him to drop his weapon.

When he continued his rampage, two cops, ages 38 and 37, each fired once, both rounds hitting him in the torso, police said.

The attacker and his victim were taken to St. Barnabas Hospital. Both were expected to survive.

The suspect has not been named because charges are still pending.

Law enforcement sources said the man had been arrested in March 2013 for assaulting the woman.

Vittini said the couple moved into the building about five months ago and kept to themselves. “They never say hi or talk to anyone,’’ she said. “I think she was afraid of him. She walked with her head down. When we were both heading out to throw away our garbage, she never said hello.’’

Additional reporting by Tomas Gaston, Daniel Prendergast and Matt McNulty