A psychologist who murdered his mother in a "frenzied attack" said he beat her with a hammer because she was trolling his estranged wife on Twitter.
Robert Child, 37, admits murdering his mother Janice, 64, at her home in Woolton, Liverpool, on 6 March.
However, he denies killing her for financial gain.
Child told Liverpool Crown Court he was shocked to discover his mother had attacked his Sri Lankan wife online and had tried to blocked her visa request.
The court was told Child transferred £25,000 from his mother's account to his own moments after carrying out the attack.
When police went to his home in Thingwall, Wirral, to inform him of her death he was out buying a £14,000 Jaguar car, the court heard.
Giving evidence at his trial of issue, he said he intended to drive the car to Italy and take his own life there.
He said he had gone to see his mother to tell her he planned to kill himself but they argued when he said he was "struggling".
He claimed his mother had used "derogatory racist terminology" about his estranged wife Sangee Perera.
"She disliked her for no other reason than the colour of her skin," he said.
Child told the court he separated from Ms Perera in 2015 but they remained married, despite him making plans to marry his new partner.
He claimed his mother told him she had sent a fax to the Home Office to withdraw a visa application for his wife and had told him she had sent her critical messages on Twitter.
"I had known Sangee had been attacked and trolled online by an unknown person or persons," Child told the court.
"I was aware of the effect it had had on her mental health... and the idea that had come from my mother... was a shock."
However, the court heard there was no evidence found on Mrs Child's laptop of her accessing any Twitter accounts.
He said: "I had made the decision that my life was going to end prior to going there that day and I think I had the conscious thought that if she was still around she would continue to attack Kelly and Sangee with even more venom."
Child accepted he had struck his mother 31 times.
"I remember the first strike. I do not remember the others. It was a frenzied attack."
The case continues.