The first minister of Wales, Carwyn Jones, has told an inquest that it would have been wrong for him to give a cabinet member details of allegations made by women about his conduct before he sacked him.

Jones said he was worried that if he had told Carl Sargeant exactly why he was being dismissed it risked exposing the identities of the women who had made the complaints.

The first minister said he did not contact Sargeant after sacking him because he felt it was not appropriate to do so.

He revealed he had told Sargeant to be careful about his behaviour three years before his death after receiving an anonymous letter in which the writer claimed he was not “fit to be around women”.

Sargeant, 49, died at his home in Connah’s Quay, north Wales, on 7 November 2017, four days after he was sacked from his role as cabinet secretary for communities and children. Sargeant’s family are deeply concerned about the manner of Sargeant’s sacking and the care – or lack of it – provided to him afterwards.

In a twist at the end of Jones’s evidence, the court heard about texts allegedly sent by a prominent north Wales councillor, Bernie Attridge, containing allegations about Sargeant that Jones’ legal team argued could give an insight into the sacked minister’s state of mind at the time of his death.

The first, sent on 1 November before it was known Sargeant would be dismissed, was said to refer to politicians being exposed for inappropriate sexual behaviour. Cathryn McGahey QC, counsel for the first minister, said Attridge wrote that he bet that Sargeant was “shitting bricks”.

In a text sent after the sacking, McGahey said, Attridge discouraged the local Labour group from coming out in support of Sargeant. She said: “He implies Mr Sargeant has done something that could lead to imprisonment.”

McGahey asked for Attridge and other witnesses to be called but the coroner, John Gittins, refused, arguing that their evidence was not required.

Earlier, Jones told the court he had known Sargeant for 16 years and considered him a friend, but said he had not known Sargent had suffered mental health difficulties for the last five years of his life and was taking antidepressants.

The first minister said that in 2014 he received an anonymous letter alleging: “He [Carl] is not fit to be around women.” Jones said he showed the letter to Sargeant and told him: “Be careful how you conduct yourself, how much you drink.”

Jones said Sargeant kept company with hard drinkers. Sargeant told the first minister his wife had received a similar letter.

In May 2016, Jones said, he was told by David Hagendyk, a former general secretary of Welsh Labour, that a woman – referred to as Miss C - had come forward to make complaints about Sargeant but did not wish the matter to be pursued.

Jones said that in October 2017 Sargeant was pencilled in to become leader of the house in a planned reshuffle. But his senior special adviser told him of rumours of inappropriate behaviour by Sargeant towards two women – Miss A and Miss B – said to have taken place in summer 2017. At the same time the #MeToo scandal was exploding in many areas of public life, including in Westminster.

Asked for his reaction to the allegations, Jones replied: “Disappointment.” The coroner told Jones he was struggling to understand why he had not spoken to Sargeant as a friend. Jones said if he had given details he could have revealed the identities of the complainants.

Jones sacked Sargeant on 3 November. “It was awful,” said Jones. “Carl was shocked but calm. He accepted there had to be an investigation and he would have to leave the cabinet. He wasn’t tearful.”

He told Sargeant he could not give him details of the allegations. “There was an enormous risk of the complainants being identified and intimidated,” he said.

Jones said Sargeant did not make a denial. “He said he didn’t recognise them. That’s not a denial. It was a curious thing to say.”

The coroner said the absence of support for someone who had lost a senior post concerned him hugely. Asked if he was worried about Sargeant, Jones replied: “Not particularly at that stage. I knew he had a network around him.”

The first minister said no measures have been put in place formally since Sargeant’s death. He said politics was a “brutal business” and politicians needed to be resilient.

The inquest continues.

• In the UK, the Samaritans can be contacted on 116 123. In the US, the National Suicide Prevention Lifeline is 1-800-273-8255. In Australia, the crisis support service Lifeline is 13 11 14. Other international suicide helplines can be found at www.befrienders.org