And at Warwick Crown Court, after pleading guilty to harassment, Hilton, who has been dismissed from the force, was sentenced to four months in prison suspended for 12 months.

Hilton, aged 50, of Lockington Close, Chellaston, Derby, was also given a community order with 12 months supervision for four offences of misusing the Police National Computer (PNC) to obtain personal information, which he had also admitted.

The officer was ordered to do 200 hours of unpaid work and to pay £450 costs and an £80 surcharge. And Judge Alan Parker imposed a restraining order banning him from seeking to contact Miss Bonsor except through solicitors without limit of time.

Prosecutor Patrick Sullivan said that at the time Hilton was a serving Warwickshire Police officer, and Miss Bonsor was a communications officer who worked as a controller for the force, and they had an off-and-on relationship. That was over by the time Hilton’s offences began in June 2010 when he accessed the PNC to obtain the keeper’s details of a vehicle owned by a man Miss Bonsor was then involved with; and he did the same again in November that year.

His harassment of Miss Bonsor began in January 2012 and continued until May last year, and during that period he accessed the PNC to get the keeper’s details of her car to find out her address after she had moved home.

Unable to accept the relationship was “well and truly over,” although he did not know where she lived, he knew only too well where she worked. He sent her flowers and bombarded her with something like 1,700 e-mails entreating her to renew the relationship.

“Such was her despair that she reported it to an inspector in the police; and he received four warnings internally to stop, and was told of the consequences if he carried on.”

But he continued to contact Miss Bonsor, and to use the PNC to trace her address before sending her a text which read, ‘I spy,’ said Mr Sullivan.

Elizabeth Power, defending, said: “He has lost literally everything by his stupidity.

“It must have been a frightening thing for her. There were no threats, but the sheer volume of them must have been driving this poor woman to despair.”

Sentencing Hilton, Judge Parker told him: “You had become utterly obsessed with her. You became a predator, and in your obsession you bombarded her with communications. Although none of them were threatening in their words, she became very frightened.

“Bearing in mind that you were a man in your late 40s with an impeccable character who had served the public, you threw it all away on an obsession you could not control.

“You were undoubtedly a victim of your own obsession with this lady, and gave not a thought at all of how your obsession affected her.

“She thought you did not know where she lived, and she became profoundly distressed when she discovered you had been misusing your position as a police officer to find the address of a man she had been having a relationship with and had then sought to find the address where she lived.

“Your obsession with her completely took over your life, and it certainly damaged her life for a period of time.

“The offences involving the misuse of the computer represent an extremely grave breach of trust.

“You have lost your career, to which you had given dedicated service. That itself must be a warning to other police officers who consider misusing the computer.”