Officers were called to the scene of the 'frightening' incident in Ramsden Road, Hexthorpe on May 16 this year when the defendant, Gavin Ridgill, phoned police to say that somebody was trying to take his dog, Sheffield Crown Court heard.
Prosecutor, Louise Gallagher, said 34-year-old Ridgill went on to threaten police, saying he 'had a knife and would use it if they didn't attend'.
She told the court that when police arrived on the scene they saw two young girls in the street, and as they went towards Ridgill's address he came out of his front door carrying weapons.
She said: "The defendant came straight out, he was swinging his arm in front of his head.
"In his right hand he had a hammer with a yellow handle. His left hand was by his side, and in that hand he had two knives. A small dog ran out of the address."
She added: "PC Ward shouted at him to put the weapons down, and he repeatedly made stabbing motions with the two knives.
"His right hand continued to swing the hammer."
PC Ward then threatened to use pava spray on Ridgill, which led to him eventually placing the hammer and the two knives on the ground.
One of the 12-year-old girls told police that the incident took place after she and a friend became concerned about the welfare of Ridgill's dog and asked him if they could walk it, which he agreed to.
But when they went to collect the dog, the girl said Ridgill, of Ramsden Road, Hexthorpe became angry at the animal and kicked it after it bit him.
Ms Gallagher said: "The girl went on to explain that minutes later she could hear the dog crying so she thought there was something wrong. They knocked on the door.
"He came out shouting and swearing saying he was going to kill them.
"The defendant came out with two knives in his two hands and was on the phone. He was walking over the road towards them when police arrived.
"She went on to say she thought she was going to die."
The court was told Ridgill had one previous conviction for animal cruelty. He admitted to a string of charges in relation to the incident including possession of a bladed weapon, using threatening words or behaviour and causing animal suffering.
Defending, Andrew Swaby, told the court that Ridgill was someone with 'quite severe learning difficulties' who had been the victim of anti-social behaviour directed at him by people in the area.
He said: "He fully acknowledges that he shouldn't have armed himself."
Mr Swaby added: "The incident was short-lived and no injuries were suffered."
Recorder Graeme Cook sentenced Ridgill to 20 weeks in prison, suspended for two years, and banned him from owning animals for life.
"This must have been an extremely frightening experience for all those involved, the young girls in particular," said Recorder Cook.
He went on to say that due to Ridgill's 'exceptional circumstances' and willingness to cooperate with social services he was persuaded that he could suspend his sentence.