A man shot his wife dead with a semi-automatic pistol in the barn of their farm days after learning of her secret affair, a court has heard.

David Leeman, 60, murdered his wife, Jennie, 44, by shooting her five times at their farm in Devon, Exeter crown court was told. Their marriage was already in trouble when Mrs Leeman, who had two sons and two daughters with the defendant, started seeing Norman Laramy, 40, the jury heard.

A month into the relationship, Laramy moved into a converted barn at the Leemans' farm, Higher Cowley, near Barnstaple in north Devon. Laramy and Mrs Leeman continued their relationship.

When Mr Leeman found out that the pair were seeing each other, Mrs Leeman left the family home and moved in with Laramy. Six days later she returned to the farm with Laramy. Mr Leeman allegedly asked if he could see his wife for a few minutes. They walked towards a barn and Laramy heard gunshots and screaming. She was shot five times in the chest.

Mr Leeman denies murder but has admitted manslaughter through loss of control – a plea rejected by the prosecution. He has pleaded guilty to possession of a prohibited weapon.

Geoffrey Mercer QC, prosecuting, said in July last year Mrs Leeman started having a relationship with Laramy. "By that stage there were clearly difficulties in her marriage to the defendant," he said.

Laramy moved into a converted barn on the farm and his relationship with Mrs Leeman continued without her husband's knowledge. The affair was eventually discovered after one of the Leemans' sons overheard a conversation between his mother and Laramy.

Mrs Leeman told her husband she was leaving him and moving out. Mr Leeman told Laramy that his wife had not been happy for years and the men shook hands.

Mercer said that Mrs Leeman and Laramy returned to her marital home on the afternoon of Sunday 18 September last year. Mr Leeman asked to speak to his wife and they walked into a barn.

"She went with him into the barn and in fact to her death, unaware he had a loaded gun with him," the prosecutor said.

"Mr Laramy heard arguing and screaming, then a gunshot and then further gunshots. The magazine was loaded with five bullets and the defendant shot her five times – emptying the magazine – at close range to her chest area. She would have died very quickly."

Mercer said Laramy ran to the barn. "The defendant came out of the barn with the gun in his hand. Mr Laramy went into the barn and saw she was dead. When he came out he was confronted by the defendant. The defendant pointed the gun at him and said: 'It should have been you first.'"

When Mr Leeman was arrested, he told police: "I did it. She would just not listen. I shot the woman I loved because she didn't do what I wanted."

The court heard the family moved to the farm from Northampton in the late 1990s. Mr Leeman had bought the pistol for "protection" and when he moved to Devon he hid it in a wall inside the farmhouse.

Mercer said: "The prosecution's case is that when he went into the barn with Jennie he had this gun loaded with him. He had armed himself with it and he took it out of his pocket and shot her repeatedly."

Mr Leeman's defence centres around "loss of control" at the time he killed his wife. "The prosecution case is that the defendant shot her having armed himself with a loaded gun, intending at the time he did it to kill her," Mercer said. "He is guilty of murder."