"He chased me and grabbed hold of me while I had my daughter in my arms.
"I yelled for help, and at him to leave us alone. All I could think of was trying to protect my daughter.
"I pushed her away from me and told her to run away. Of course she's only 3, so she tried to run back towards me."
A police spokeswoman said a fight broke out between the two men.
The girl was unharmed and no one else was injured.
Police confirmed they have arrested a 32-year-old man allegedly involved in the attempted abduction and assault. A court date has yet to be set.
Whitby resident Jo Alderdice told Fairfax she stepped in after seeing two men fighting over the young girl.
Alderdice said the pair were swearing and yelling outside a house.
"I instantly knew one of them was trying to snatch her, so my first thought was just to get the girl," Alderdice said.
She said they dropped the girl as she ran towards them and she took the girl back to her house.
"I grabbed her and ran into my house and locked the doors, screaming for someone to call the police."
She said the man then tried to break down her front door and another neighbour stepped in to help and ended up knocking through her fence.
"He was not going to stop until they made him stop," she told Fairfax.
The father told Fairfax that, when they first saw the man, "he was shuffling and swaying a little bit, and not engaging".
"He was following about a foot behind us. I could hear him breathing heavily and muttering swear words.
"I stopped to see if he would walk past but he didn't, so my first thought was to get on to the street away from him and in a public view."
The man in custody was in the process of being admitted to mental health services provider Pathway Health at the time of the alleged attack.
Pathways Health chief executive Sally Pitts-Brown said the man was placed there by the clinical team at Capital and Coast DHB.
"We are deeply shocked and distressed. Our main focus at this point is on supporting the well-being of all of the people involved, in any way we can."
Pitts-Brown said the Pathways service was not a secure environment.
"We provide supported home-like environments where people can have a short break when they need to rest and focus completely on their well-being."
She said staff were working with police in their investigation.
"We are also supporting our staff and people who use our services that have been affected by this situation."
Northern Ward councillor Anita Baker said she was shocked but Whitby streets were no more dangerous because of it.
"It was a one-off. We don't need to be paranoid, we just need to carry on what we're doing, which is looking after each other in the community and enjoying living in Whitby."
Baker said the actions of neighbours who intervened reflected how tight-knit the community was.
"There's usually someone on a driveway, behind a curtain, watching. There are people here that support each other, we have really good community networks."