Nine-year-old Olivia Pratt-Korbel was killed by a gunman in "ruthless pursuit" of his intended victim, a court has heard.
The bullet allegedly shot by Thomas Cashman was fired through the front door of her home in Liverpool, hitting the hand of her mother Cheryl Korbel, 46, before fatally wounding her, Manchester Crown Court heard on Tuesday.
Opening the case, David McLachlan KC, prosecuting, said: "It is about the ruthless pursuit by Thomas Cashman to shoot Joseph Nee at all costs without any consideration for anyone else in the community.
"Such was the planning and ruthless nature of this attack that Thomas Cashman, we say, went armed and was in possession of two loaded firearms.
"When, in all likelihood one of them failed, he simply turned to the other one to execute, literally, his plan.
"Thomas Cashman's actions resulted in Joseph Nee being injured, Cheryl Korbel being injured, and most tragically of all in this case, Olivia Pratt-Korbel being killed."
Mr McLachlan said on the evening of August 22 last year Cashman, 34, had been "lying in wait" for Joseph Nee, who was watching a football match at the home of another man, Timothy Naylor, in Dovecot, Liverpool.
The court heard when Mr Nee left the house at about 10pm a gunman, who the prosecution allege was Cashman, ran behind him and fired three shots from a self-loading pistol, one of which hit Mr Nee in the midriff.
Mr Nee stumbled and Cashman stood over him and tried to fire again but, possibly because the pistol malfunctioned, he was unable to complete his "task" and kill Mr Nee, Mr McLachlan said.
The prosecutor said Ms Korbel opened her door after hearing noise outside and as she did Mr Nee "made a dash" towards her house, with Cashman in pursuit.
Cashman fired at Mr Nee from a second weapon, a revolver, and hit the front door of the family home, the court heard.
Mr McLachlan said: "That fourth likely shot passed through the door, it then passed through Cheryl Korbel's right hand as she was no doubt trying to shut the door. The bullet then went into the chest of Cheryl Korbel's daughter Olivia Pratt-Korbel."
Mr Nee managed to get inside the house and Cashman allegedly fired again into the doorframe, after getting his arm around the door, before running away.
Olivia was pronounced dead at Alder Hey Children's Hospital later that night.
The jury of 10 men and two women were told the main issue in the case would be whether they were sure Cashman was the gunman.
Mr McLachlan said: “He does not accept that that was him.”
Cashman, of Grenadier Drive, Liverpool, denies the murder of Olivia, the attempted murder of Joseph Nee, wounding with intent to do grievous bodily harm to Ms Korbel and two counts of possession of a firearm with intent to endanger life.
The trial is expected to last four weeks.