A father killed his three-week-old son after being "overwhelmed by intrusive thoughts" about his sexuality, a court has heard.
Kadees Mohammed, 30, from Birmingham has gone on trial at Birmingham Crown Court accused of murdering his baby on 18 October, 2022.
Mr Mohammed also allegedly attacked his wife and mother with an iron when they tried to protect the newborn.
The defendant, who denies all charges, appeared via video-link at the hearing.
At the start of the trial, prosecutor Harpreet Sandu KC said that there was "no dispute" about the defendant killing his son and seriously injuring his wife and mother.
Instead, he said the case would focus on the defendant's mental state during the run-up to the killing of three-week-old Mohammed Ibrahim.
On October 15 2022, Mr Mohammed, of Dovey Road, Sparkhill downloaded the gay dating app Grindr, and Mr Sandhu said analysis of the defendant's phone suggested he was a man who "struggled" with his sexuality.
The court also heard that the defendant, who worked for the Department for Environment, Food & Rural Affairs (DEFRA), had become "fixated" with the idea that he had attention deficit hyperactivity disorder (ADHD) and was seeking a professional diagnosis.
The day before the attack, the father-of-two spoke of having "suicidal thoughts", leading his concerned family to call the emergency services.
A message from Mr Mohammed's wife, Mehwish Mubashir, to Mr Mohammed's sister, claimed that he was saying "again and again" that he would die.
His sister called the police about her brother "having a mental breakdown", with police officers recommending a safeguarding check to the ambulance service due to the three-week-old baby living at the address.
In a call to the ambulance service made by Mr Mohammed's sister hours later, after the situation had escalated, she said: "My brother's having very intrusive, suicidal thoughts. He's telling us he's going to commit suicide in the next hour."
Speaking to the call handler for the ambulance service, Mr Mohammed said: "I just want to go to sleep and not wake up."
The court was shown a video recording of a police interview with Mr Mohammed's wife, Mehwish Mubashir, who spoke of Mr Mohammed's mental state the day before the attack.
Ms Mubashir said via an interpreter that after returning from the mosque, Mr Mohammed kept washing his hands "over and over again" as he had a "weird feeling" that he wasn't "clean".
She also stated that he was worried about intrusive thoughts he was experiencing, but when she asked him to talk about them, he told her: "I can't tell you because you'll become very upset."
"I became quite concerned about his behaviour, he's never reacted like that," Ms Mubashir said. "He would always kiss the children, but that day he didn't."
Commenting on her conversation with the ambulance call handler, she said: "I was very upset. I told them he wouldn't let the children have food.
"They asked me about his medical history and asked me if I was safe and I said 'I really can't say'."
'I don't think he's breathing'
The court heard that Mr Mohammed's family were warned they might have to wait "six hours or longer" for an ambulance as the service was "extremely busy".
An ambulance arrived 46 minutes later but by this time Mr Mohammed had made his own way to the hospital with his sister and brother-in-law, who had driven up from London out of concern for him.
He waited at the hospital for less than 40 minutes then went home after being told there would be a minimum three-hour wait for a psychiatric assessment.
He got home at around 02:16 GMT.
CCTV audio from Dovey Road picked up noises that the prosecution said signalled the "beginning of the offending" at 03:32.
The court heard that Ms Mubashir woke up at 03:00 to find her baby son on the ground, with her husband kneeling over him repeating the words: "Allahu Akhbar."
After Mr Mohammed attacked his wife and mother with an iron, Ms Mubashir took her child outside and started knocking on neighbours' doors, the court heard.
In a phone call made to the police, an unknown male said: "I think the dad has attacked a newborn baby. There's blood everywhere." Speaking of the baby, he added: "I don't think he's breathing."
At 03:46, Ms Mubashir messaged her sister-in-law and said: "He died. My baby."
The defendant denies murder, manslaughter and two charges of wounding with intent.
The trial continues.