A jury heard Julian Ridgeway was arrested after a couple hid in a barn and kept watch when they became concerned about the way their 13-year-old mare had been behaving.
Leeds Crown Court heard the couple hid and watched as Ridgeway lead the horse, called Honey, into a pig pen in an outbuilding before challenging him.
Ridgeway ran off from the farm, in Netherton, near Wakefield, but was later questioned by police and denied being the man involved.
Patrick Palmer, prosecuting, said the animal was later examined by a vet and evidence was recovered from the animal which matched Ridgeway’s DNA.
The jury was told that 25 years ago, Ridgeway had been found at a stables in the Wakefield area seemingly about to have sex with a horse.
The prosecutor said on that occasion he had been seen stood behind the animal with his trousers down.
In another incident in 2011, Rideway’s home was searched by police and a video cassette was found of a man having sex with a horse.
Ridgeway, 53, of South Lane, Netherton, pleads not guilty to intercourse with an animal and trespass with intent to commit a sexual offence.
The offences are alleged to have taken place between April 18 and May 10 this year.
Mr Palmer said: “The prosecution say he intended to commit an offence on the premises that night and had done so before.”
The court heard the horse’s owner, Louise Lumley, became suspicious when she started to notice the way that the chain on the gate to the pen where Honey was kept had been set differently.
The prosecutor told the jury: “She also noticed that the horse’s behaviour was quite different and became concerned about what was happening.
“She and her husband decided to keep a special eye on the stabling and the horse.”
The jury heard the couple stood on buckets in an outbuilding one evening and saw the defendant go to the pen where the horse was kept.
They watched as he led the animal out of the open into the building where they were.
The court heard Ridgeway did not see the couple but the horse put her head up and “gave the game away” by alerting the defendant to their presence.
Giving evidence, Mrs Lumley told the court: “I asked what he was doing with my horse. My husband said it was Ridgeway.”
Ridgeway ran off but was later interviewed and denied any involvement.
He claimed he had been at home listening to a football match followed by Today in Parliament on the radio.
Ridgeway claimed that the Lumley’s must have been mistaken.
Ridgeway was arrested after swabs were taken from the horse and the sample was found to contain his DNA.
He was arrested and made no comment in interview.
Mr Palmer said Ridgeway had submitted a defence statement in which he accepted going to the farm after hearing a burglar alarm go off.
He also claims in the statement that had put his hand inside the horse once to see what would happen, but denies his actions had been of a sexual nature.