A man stabbed his "trusting and defenceless" eight-year-old daughter to death after threatening to kill her mother, a court has heard.
Mylee Billingham died after being found with a knife wound to her chest at her father's home near Walsall in January.
William Billingham, 55, was struggling to cope with his ex-partner's decision to start a relationship with another woman, Birmingham Crown Court was told.
He denies murder and making a threat to kill.
Opening the case, prosecutor Karim Khalil QC said moments before Mylee was attacked on 20 January, Tracey Taundry had arrived to collect her daughter from Mr Billingham's house in Valley View, Brownhills.
"Whilst at the front door the defendant threatened to kill Tracey with the same knife and she had run off a short distance," he said.
Mr Billingham met Miss Taundry when she was 19 and he was 40 and the relationship had initially caused tensions between her and his older children, the court heard.
In 2010 she called police alleging he had struck her and thrown things around their flat, but she chose not pursue charges.
Miss Taundry's bisexuality had often been a cause for light-hearted banter between her and Mr Billingham, the court heard.
She met a woman who became her regular partner and the prosecutor said the fact this seemed to be getting more serious was something the defendant "seemed to be struggling to deal with".
Mr Khalil told the jury: "We say his actions were plainly hostile to this new situation."
Mr Billingham eventually moved out, with Miss Taundry describing them as initially remaining "friends with benefits".
Mr Khalil said jury members were likely to have to consider Mr Billingham's mental state when Mylee was fatally injured at his house.
"The defendant did provide an account in interview of the time leading up to these terrible events, but he claimed to have no memory of the events themselves," he said.
"He has therefore provided little by way of explanation for what he did.
"Whether or not he can remember the events does not affect his responsibility for them."
The trial continues.