A dog that mauled a five-year-old to death was let into the house by the girl's grandmother even though she knew it was dangerous, a court has heard.
Ellie suffered severe head and neck injuries
Ellie Lawrenson was attacked by the pit-bull terrier-type at Jackie Simpson's home on New Year's Day.
The 45-year-old, who had taken drugs and alcohol on the day, went against a family agreement not to allow the dog - Reuben - into the home in St Helens.
Ms Simpson denies manslaughter through gross negligence.
The Crown Prosecution Service said she knew the dog was dangerous as she herself had witnessed it attacking two other people.
Ellie Lawrenson suffered more than 72 injuries when the dog locked its jaws around her throat and shook her in the living room of her grandmother's home in Knowles House Avenue.
Ms Simpson, who witnessed the attack and was injured by the dog, was supposed to keep the animal outside, the prosecution said.
Mrs Simpson denies manslaughter through gross negligence
Neil Flewitt QC told Liverpool Crown Court her judgment may have been impaired by smoking cannabis and drinking alcohol.
He said: "It was the view of the forensic scientist who carried out the analysis that 'the concurrent presence of these drugs has the potential to have affected her actions at the time of the incident'."
However, the forensic scientist was unable to say to what extent she may have been affected.
Ellie was dead at the scene when paramedics arrived in the early hours of New Year's Day.
The court heard that Reuben, who belonged to Ms Simpson's son, Kiel, attacked a neighbour in May 2006 and then attacked her daughter, Kelsey, in November which resulted in her being treated in hospital.
The court was told that following the attack on the aunt, the family decided that the dog needed to be outside when Ellie was in the house.
Mr Flewitt said: "There is no doubt that the defendant was aware of, and agreed to and generally complied with these arrangements so as to ensure that there was no contact between Reuben and either Kelsey Simpson or Ellie."
But minutes before the fatal attack, which Ms Simpson told police might have been sparked by a firework, she took pity on Reuben, who was "crying and whimpering" outside.
In a police interview she admitted she should have kept the dog outside, telling officers: "I shouldn't have let him in, should I?"
"He just looked scared and, I don't know, I have asked myself a million, million times why did I do it?
"He just didn't look like he normally looked, he just looked scared.
"I let him in and he was all right, when he come in he was just wagging his tail, running round your legs like he used to."
The dog was destroyed following the attack
But that quickly changed, she told officers, when the dog attacked Ellie.
"I was fighting with it, I was trying to get it off her," she told police.
"It put her down, it just started running round barking and just barking, just barking.
"I just tried to get it out of the door with some biscuits or anything.
"I couldn't grab it, because there was blood everywhere."
Reuben was eventually shot dead by police handlers.
Mr Flewitt said: "She knew that Reuben had become dangerous and she knew that precautions had been put in place to ensure he did not come into contact with Ellie.
"Yet, for no good reason, she allowed Reuben to have access to Ellie in circumstances that undoubtedly led directly to her death."
The trial was adjourned until Tuesday.