A builder accused of murdering his wife's lover "panicked" after he died during a confrontation at a remote farm, a court has heard.

Andrew Jones, 53, is alleged to have shot Michael O'Leary, 55, after discovering the older man was having an affair with his wife.

The father-of-three claims the .22 Colt rifle went off accidentally while he and Mr O'Leary grappled during an argument at Cyncoed Farm in Carmarthenshire in January.

Jones disposed of Mr O'Leary's body by burning it in an oil drum at a yard next to his home in Carmarthen, Swansea Crown Court heard.

In his closing speech, Karim Khalil QC, defending, told the jurors that once they had analysed all the evidence - putting emotion to one side - they could conclude it was a "terrible accident".

Mr Khalil said that after the shooting Jones "wasn't thinking straight" and did not call the emergency services.

"Mr Jones's answer was that, confronted by the horror of one of his best friends dead in his arms, he panicked," he said.

"He panicked in the knowledge that if he hadn't taken that gun to the scene his friend wouldn't be dead.

"He panicked because he couldn't face Mike O'Leary's wife and children, all of whom he knew and liked. In this moment he thought it better if Mike's family thought he had took his own life.

"He panicked because he wanted to spare them all of knowing of the affair that Michael O'Leary had been conducting with his own wife Rhianon for so long."

Mr Khalil added: "Once he had taken that first wrong step, he was set on a path which spiralled further and further out of control.

"As he said in evidence, he had dug a hole for himself. Remember the old saying, 'If you are in a hole, stop digging'. Nobody does."

The barrister said the prosecution assertion of a pre-planned murder "simply does not add up".

"The prosecution case doesn't fit when you step back and analyse the evidence fairly," he said.

"He wasn't planning to kill Michael O'Leary, he did plan to meet him there to talk about Rhianon, and it has got horribly out of control."

Mr Khalil said the prosecution's case that Mr O'Leary's murder was planned overlooked a lack of planning for disposing of his body.

"The one place you are not going to take it is home," he said.

"If you are so stupid as to take it home, the next thing you are not going to do is leave the body outside in the yard where any inquisitive person, including a member of your family, might just come across it."

Mr Khalil also told the jury that someone who had planned a murder would not burn the remains in a yard next to their home, as that would attract attention.

"This level of risk-taking, we submit, shows it was not planned at all. This is him getting deeper and deeper into absurd things, ghastly things," he said.

"He was being driven by something else, other than careful planning."

Jones, of Bronwydd Road, Carmarthen, denies murder. The trial continues.