The mummified remains of a four-year-old boy were discovered in a cot thanks to the tenacity of an inexperienced officer who noticed a "vile smell of filth" coming from a rubbish-strewn house, a court heard.

Hamzah Khan had been dead for 21 months when police community support officer (PCSO) Jodie Dunsmore became suspicious about his family and their terraced home in Bradford, West Yorkshire.

Dunsmore, who is now a police officer, had been called to the property after a neighbour complained about rubbish being thrown into his garden in the middle of the night. The blinds were always down and no one answered the door on at least five occasions when she visited, but the PCSO became suspicious after spotting dead flies on the windowsill. On a subsequent call she managed to pierce a plastic bag covering the letter box and was confronted by a "vile smell of filth radiating from the house".

The officer had a gut feeling that something was wrong, she told Bradford crown court. She phoned Bradford social services to find out who lived at the property, after a neighbour said social workers had also failed to gain entry to the house.

On 21 September 2011 Amanda Hutton, Hamzah's mother, eventually answered the door after Dunsmore threatened to break the door down, which was a bluff as PCSOs do not have the power of entry.

Dunsmore said Hutton looked "dreadful". "Her hair was all matted and she was looking very unkempt. She had a woollen jumper on and it appeared flies were coming off her jumper … She looked like she was going to throw up. She had a look of fear on her face … I thought she was hiding something."

The court heard that the new officer's "conscientious and tenacious approach to the situation would have done a seasoned detective credit".

Within an hour, more officers arrived and found damp rooms in the three-storey property ankle-deep in rubbish, faeces and rotting food, with fruit flies and bluebottles buzzing around. Empty vodka bottles filled the kitchen top and the bathroom sink was caked in vomit. The only room in the house where the carpet was visible was Hutton's own, relatively clean bedroom. It was in this room that an officer made the terrible discovery of Hamzah's remains, piled under detritus in a travel cot. Although he was over four years old when he died, he was wearing a babygrow for a six to nine-month-old baby and his bones showed signs of severe malnourishment.

Now 43, Hutton is on trial for killing him through neglect. Just before Hamzah was found, she told officers he was staying with an uncle in Portsmouth, the court heard. She then claimed he died after an illness on 15 December 2009, but denies manslaughter.

On Tuesday Hutton cried in the dock as photographs of her squalid house were shown to the jury. Earlier in the day a domestic violence officer from the vulnerable victims unit at West Yorkshire police recalled how Hutton, a self-declared alcoholic, had rejected help from doctors having "lost faith" in the health service after her mother died of cancer in 2005.

A neighbour also gave evidence that Hutton was tearful and would often come around to her house drunk, until she stopped answering the door to her. Another neighbour testified that Hutton told her she would visit her ex-partner at night, despite having succeeded in gaining an injunction against him after he was convicted of assaulting her in December 2008. The case continues.