The former Welsh first minister Carwyn Jones has been accused of lying under oath over the support measures put in place to protect a colleague who was found dead after allegations of inappropriate sexual behaviour.

Carl Sargeant died four days after being sacked by Jones from his post in the Welsh government. Family and friends strongly believe the way the dismissal was handled left him in despair.

Giving evidence at the start of the inquest into Sargeant’s death last year, Jones had explained that a veteran Labour politician, Ann Jones, had been asked to stay in touch with Sargeant during the weekend after the sacking. Carwyn Jones had testified that he had spoken to Ann Jones over that weekend.

However, he told the resumed inquest in Ruthin, north Wales, on Monday that in fact he had not spoken to her that weekend. He insisted his previous evidence had been a mistake rather than a lie.

During fiery exchanges, Leslie Thomas QC – the barrister for Sargeant’s widow, Bernie, and son, Jack – directly accused Carwyn Jones of lying.

Thomas suggested the former first minister had only corrected his “mistake” after Ann Jones had flagged up that it was wrong. Thomas said: “You were caught out in a lie.” Carwyn Jones asked: “Are you accusing me of lying?” Thomas answered: “Yes, you were caught in a lie.”

The coroner, John Gittins, said he would make a judgment on Carwyn Jones’s credibility. He told Jones: “Either you were mistaken in what you said to me or I was misled, and perhaps deliberately so, with a view to some type of PR that made your position somewhat more tenable.”

When the inquest resumed, Ann Jones was the first to give evidence. She said she had not been given a formal role to care for Sargeant. Jones said that on the night after Sargeant was sacked she received a text message from Carwyn Jones’s special adviser, Matt Greenough, asking her to “give him a bell” over the weekend.

She told the inquest she had rung and messaged Sargeant but had received no response until Monday, the evening before his death, when he sent her several texts.

In one read to the court, Sargeant wrote: “I still have no idea of the allegation detail, all we know is off the BBC what the first minister briefed. Bastards. I’m telling no one again I’m thinking of running for first minister.”

Thomas suggested to Jones: “He feels he has been, for want of a better expression, stitched up because it was known he was thinking of applying for the first minister role.” Jones replied: “I don’t know what was behind Carl’s thinking on that one.”

She said the first minister had phoned her the day after Sargeant’s death. She told the coroner’s court: “He said that he was going to say to the press that he had asked me to provide a caring role to Carl. I remember saying to him: ‘Don’t do that, that’s not what my understanding was.’”

Carwyn Jones, who stood down as first minister last year and remains AM for Bridgend, told the inquest he believed Sargeant had a “circle of support” around him and added: “If Carl needed help or advice he could have gone to Ann to get it … if there had been any difficulties Ann would have let us know.”

Andy Sargeant, Carl’s brother, who was asking questions on behalf of other family members, told Jones: “For me, Mr Jones, it’s not a mistake. Your statement [on the contact he had with Ann Jones] isn’t a mistake, it’s a damage-limitation exercise.”

Jones sacked Sargeant, the AM for Alyn and Deeside in north Wales, from his job as cabinet secretary for communities and children in November 2017.

The inquest continues.