Police seized but then handed back a suspected dangerous dog a week before it killed former lollipop man David Ellam.
Aaron Joseph, 30, has gone on trial accused of being the owner of the dog which savaged Mr Ellam to death.
Mr Ellam, 52, a keen Huddersfield Town fan, was attacked outside his home in Riddings Road, Sheepridge, on August 15, 2016.
He was trying to protect his Yorkshire Terrier, Rollo, from a cross-bred Staffordshire bull terrier, which was later destroyed.
Mr Ellam suffered serious bite wounds and died in hospital 12 hours after the attack.
Joseph, then a neighbour, now of Hopkinson Road, Sheepridge, denies a charge of being the owner of a dog, Alex, which caused death whilst it was dangerously out of control.
Richard Walters, prosecuting, told a jury at Leeds Crown Court that Mr Ellam lived in the same block of flats as Joseph.
He said on the fateful day the bull terrier type dog escaped from its pen by digging underneath it and began attacking Mr Ellam.
In dramatic evidence Mr Walters said: “Just after 9.30am neighbours heard Mr Ellam shouting: ‘Help me, please, somebody help me.’
“Mr Ellam was by his door and Alex was seen to have hold of him by the arm. She was panting and scraping her paws on the ground.
“Alex at some stage then bit Mr Ellam’s leg. His cries for help were becoming more desperate and people could see there was a lot of blood.
“Alex was growling and snarling and Mr Ellam was heard to say he couldn’t take much more. Ominously his cries became fewer and fewer apart.
“Mr Ellam was seen to be unconscious and it was noted the dog was dragging him.
“A number of neighbours had seen these distressing scenes. They were trying to help and one even brought a knife to try and stab the dog but none of them approached Alex.”
Eventually a police officer subdued her by spraying her in the face with a fire extinguisher and she ran off.
She then turned on Mr Ellam’s dog Rollo and at one stage had him in her mouth.
Mr Ellam was taken to Huddersfield Royal Infirmary but died at 8.59pm.
The court heard that there had been a series of incidents in which Alex had bitten a number of neighbours dating back to 2012.
Mr Walters said Kirklees Council took action at the magistrates’ court on October 9, 2012, and made a control order insisting Alex be muzzled at all times in the open air, neutered and microchipped.
However, he said there was no evidence that the defendant “did anything to control Alex.”
Ironically Mr Ellam was so concerned at the dog’s behaviour that he reported it to council dog wardens wondering if it was a pit bull terrier, a breed banned in Britain.
The police seized the dog on June 27 but following an examination they decided it was not a banned breed and returned it to the defendant on August 8.
Mr Ellam was a Town fan and popular figure in the local community, doing voluntary work for local groups including the YMCA and the Royal Voluntary Service.
He worked as a lollipop man at Paddock Junior and Infant School.
An investigation has been carried out by the Independent Police Complaints Commission. Its findings will be published after the trial.
The trial continues.