Two pit bulls that had been viciously chomping on a man for over 15 minutes in a Brooklyn home were shot and killed by police because the officers were unable to whack the dogs off with a two-by-four, witnesses and police said.

Officers responded to the home on Hancock Street in Bushwick around 10:30 p.m. Saturday and saw the dogs viciously attacking Paul “Nitty” Davis, 50, who had been renting out some space in the basement.

Davis was taken to King’s County Hospital with bites to his arms and legs and is in stable condition, officials said.

Devon Dixon, another resident of the home, said Davis was a bloody mess, but was awake and alert when he was put into the ambulance.

Dixon admitted to The Post it was the fault of his animal-loving character that the aggressive dogs were inside the house.

He rescued them two weeks earlier, he said, because he saw the pooches chained up and unattended in the yard of a neighbor, who he knew had taken off on a trip to Pennsylvania.

“They were both drooling out the mouth and people were going across the street to get away from them,” he said. “I fed them right there, then brought them home.”

Dixon said he was hosting a party Saturday on the first floor of the home when the dogs suddenly began growling and attacking Davis one floor below.

As Davis screamed, Dixon said he called the cops, grabbed a two-by-four and went to help.

“I see Nitty, he’s over on the couch with both dogs on him. One’s got his leg and the other one’s got his arm,” said the still-shaken 26-year-old.

He said he tried to hit them with the beam, but they charged at him.

“I jumped over the couch and ran out of the room and slammed the door,” he said.”The dog ran back and jumped on Nitty …At that point they were full-flesh into him.”

Dixon said four or five officers responded to the call.

“I told them ‘I’ve been hitting them with a two-by-four, I’ve been spraying them with mace, and they’re not letting go.’”

Dixon said responding officers also tried to pry the frenzied beasts away from their victim with the beam — but ended up having to take out their weapons.

“I heard at least ten gunshots. It was at least a whole round. But they had to — Nitty was losing a lot of blood.

“They bit him all the way down to his bone where you could see the definition of his bone. You could see the veins in his legs and everything.”

Davis’s niece, Diana Rodriguez, 21, said she rushed over as soon as she heard. She said she had met the dogs during her last visit and was already alarmed by the younger dog’s demeanor.

“He had that ‘I don’t give a f–k’ face,” she said.

“These dogs didn’t really know us. We didn’t know about these dogs. We had the heart to bring them back here when the real owner had no heart. They played like they were nice, but they were really f–king vicious.”