A maths teacher stabbed his estranged girlfriend to death when she obtained a court order to make him leave their Hampshire home, a court has heard.
Blair Marrows, 45, admits stabbing 44-year-old Donna Coe, 29 times in a "frenzied" attack on the stairs of their £445,000 Petersfield house.
Mr Marrows denies murder on the grounds of provocation.
Winchester Crown Court was told that Mr Marrows tried to take his own life after the attack on 21 March 2008.
The killing took place at the detached property in Dickins Lane.
Nigel Pascoe QC, prosecuting, told the jury that the pair had been leading separate lives since a split two years earlier.
Mr Pascoe said that Mr Marrows did not want to leave the house because it was a valuable asset.
He said that "intelligent" Mr Marrows told police that Mrs Coe, a mother of one, had attacked him with a knife, which he took from her, before he hit her with a bag of coins and stabbed her.
"So the atmosphere in the house became tense and acrimonious," said Mr Pascoe.
"We say it engendered anger, frustration, distress and ultimately hatred."
The jury was told Mr Marrows had said to his new girlfriend Sophia Harris that he wanted to kill Mrs Coe and then himself, the night before the alleged murder.
Mrs Coe - a teacher at the independent Priorsfield Girls' School in Godalming, Surrey - was found by her ex-husband Andrew Coe when he went to the house and saw her body through the letterbox.
Police found Mr Marrows in a bath of warm water upstairs. He said he had tried to commit suicide but failed.
The trial continues.