A doctor put Patrick Quirke on a course of antidepressants to help him sleep after he complained of being stressed over his affair with Mary Lowry, the Central Criminal Court has heard.
Tipperary GP Dr Ivor Hanrahan said Mr Quirke, who is on trial for the murder of Bobby 'Mr Moonlight' Ryan, was "upset and quite hurt" about Ms Lowry's relationship with Mr Ryan.
Mr Quirke (50), of Breanshamore, Co Tipperary, has pleaded not guilty to the murder of part-time DJ Mr Ryan.
Mr Ryan (52) went missing on June 3, 2011, after leaving Ms Lowry's home at about 6.30am.
His body was found 22 months later, in April 2013, in an underground run-off tank on the farm owned by Ms Lowry and leased by the accused at Fawnagown, Tipperary.
The prosecution claims Mr Quirke murdered Mr Ryan so he could rekindle an affair with Ms Lowry (52).
Yesterday, Dr Hanrahan told prosecution counsel Michael Bowman that Mr Quirke came for a routine consultation in September 2010 and mentioned a number of work and financial "stressors" he was dealing with at the time and that he was having difficulty sleeping.
The doctor suggested medic- ation, but Mr Quirke was not keen, so the doctor referred him to a counsellor.
Around mid-September, Dr Hanrahan received a phone call from the counsellor, and as a result of what he heard he prescribed mirtazapine, an antidepressant, to Mr Quirke.
He said he primarily prescribed the drug to help Mr Quirke sleep.
In late 2010 and January 2011, the doctor had a number of phone conversations with the accused over a 10-day period and prescribed a number of other medications to help with sleep disturbance.
He said Mr Quirke remained upset and distressed and had other issues that he did not want to discuss.
Dr Hanrahan suggested a face-to-face consultation, which took place on February 3, 2011.
They had a long consultation during which Mr Quirke told the doctor he had been having an affair with Ms Lowry, his wife's sister-in-law, which was a source of stress and upset.
Mr Quirke asked the doctor not to make a note of the conversation, so the doctor wrote in his file only that they discussed a confidential matter.
By the time this conversation took place, he said, Mr Quirke had stopped taking the medication as it did not seem to have helped him.
They discussed the impact of the affair on Mr Quirke's mental health and well-being.
From what Mr Quirke told him, the doctor believed the affair had at that point come to an end because Ms Lowry had started a relationship with another man.
He said his understanding was that Mr Quirke still had feelings for her and "was quite hurt and upset that she had become involved with somebody else".
Under cross-examination, he told defence counsel Bernard Condon that Mr Quirke may not have met the criteria for depression.
The doctor agreed with Mr Condon that Mr Quirke may have thought he had been diagnosed with depression because of the medication he was prescribed, but the doctor repeated that he had prescribed the medication "mainly" to treat sleep disturbance.
Artificial insemination technician Breda O'Dwyer told Mr Bowman she worked with Mr Quirke's cows for about 15 years.
She had an understanding with Mr Quirke that she would call to his farm every morning unless he texted her to say he did not have any cows bulling.
By the time she arrived at his farm, she said, Mr Quirke would normally have finished milking and be on his way for his breakfast.
On June 3, 2011, the day Mr Ryan went missing, she said that as far as she could recollect, Mr Quirke was still in the pit milking his cows when she arrived. The time would have been "9.30 anyway", she said.
Ms Justice Eileen Creedon told the jury it was not needed today but will be tomorrow.