Dr Alexander Quinn assessed the mental state of Lukasz Czapla after his son Julius was found dead at a property in Muirhouse in Edinburgh in November 2020.
Czapla denies murdering the toddler in his home in November 2020.
He plead guilty to the lesser charge of culpable homicide, but this was rejected by the Crown.
Previous evidence heard Czapla said he could not remember the events of the night the toddler was killed in his own flat.
But at the High Court in Edinburgh on Wednesday, Dr Quinn spoke about a third interview he had with the accused after it emerged he could remember more detail about his son’s death.
In a statement read out to the 15-strong jury, Dr Quinn described the interview as “harrowing”.
“Taking an account of someone killing a child doesn’t come along very often,” he told the court.
“It’s not something you do regularly in your career and you approach it with trepidation and caution.”
The court heard Czapla told the psychiatrist that he had tried to end his son’s life by shooting the toddler in the head with a BB gun, but failed.
Upon seeing his child in a “distressed manner” and “handicapped”, Czapla then told Dr Quinn he proceeded to stab and smother Julius.
The psychiatrist said the accused’s experiences of “seeing his son suffering” are why Czapla “perhaps acted in the way he did after he shot him”.
Dr Quinn said it was difficult for Czapla at the time to make sense of an event that involved the “build-up that was traumatic then the three stages that led to the killing of his son”.
He explained the accused was unable to articulate some of what had happened, but could “gesticulate through actions what had occurred”.
Iain McSporran QC, defending, put it to Dr Quinn: “The shooting didn’t kill him (Julius), so he found himself with a distressed and disabled child, then went on to do other things to him?”
To which the witness replied: “That’s what he described it as, yes.”
Czapla’s lawyers have lodged a special defence which states he should be acquitted of murder because he had diminished responsibility at the time of Julius’ death.
Dr Quinn told the court he has “made it clear” that the accused was suffering from a “depressive illness” at the time of his son’s death.
An opinion statement written by the psychiatrist after interviewing Czapla was read out in court.
It said: “It would appear that Mr Czapla’s depressive illness had a substantial role to play in the events which led to the killing of his son.
“It’s my opinion that his depressive illness would have played a substantial impairment in Mr Czapla’s ability to control his conduct.
“At the time of the killing, Mr Czapla was also intoxicated with a mixture of alcohol and antidepressant tablets.
“In my opinion this would have played a role in reducing Mr Czapla’s impulsive control, muddling his thinking and most likely making actions less coherent.”
Mr McSporran asked the witness to confirm if this was his opinion, to which Mr Quinn replied: “At the time, yes.”
The trial, before Lord Beckett, continues.