A Bronx man grabbed a baseball bat and beat a pit bull at least 20 times as the dog attacked a 4-year-old girl on his street Wednesday morning.

The hero slugger, 43-year-old Bobby Mahoney, said he was getting his daughters ready for school at about 8 a.m. when he noticed a pair of pit bulls acting aggressively outside his house on Huxley Avenue near West 261st Street in Riverdale.

He was about to call 911 when he heard screaming from outside, he added.

“I came back to the door and the dog was already on the little girl,” Mahoney said of the 50-pound pit bull that had chomped down on the 4-year-old’s face while she was waiting for a bus.

“The first thing that came to mind was grab something to make him let go. And that’s what I did,” Mahoney added.

He said he grabbed a baseball bat, rushed over to the girl and began to hit the dog with it.

“He finally let the girl go. After he let them go I was able to hit him a couple times in the head. And he just ran,” Mahoney said.

He then stayed with the girl, who was bleeding heavily from face, and her mother until an ambulance came.

The girl was taken to Jacobi Medical Center where she was in critical but stable condition, police said. The beast was turned over to the ASPCA, cops said. No charges have been filed against the dog’s owner.