A police constable who had sex with an ex-prostitute while on duty and searched his force's computer system for details of other women has been jailed for two-and-a-half years.

Jasbir Singh Dhanda, who committed the offences while employed by Derbyshire Constabulary, resigned from the force within minutes of being convicted of misconduct charges.

A jury at Nottingham Crown Court took just over six hours to convict Dhanda of three counts of misconduct in a public office and three of breaching data protection laws following a trial at Nottingham Crown Court.

Although the officer was cleared of five charges, he was found guilty of four counts relating to the former prostitute, with whom he had sex between January 2008 and July 2010.

Sentencing Dhanda, Recorder of Nottingham Judge Michael Stokes QC said the 52-year-old was guilty of "persistent breaches" of his duty as a constable.

Dhanda, of Littleover, Derby, showed little emotion as he was sentenced, having signed and submitted a letter of resignation immediately after hearing the jury's verdicts.

The judge heard that Dhanda, who suffers from an incurable degenerative illness, misused a police database to access details of two other women.

Informing Dhanda that he will be required to serve up to half of the two-and-a-half-year sentence, Judge Stokes said: "It is a matter of great regret to see a police officer of almost 17 years' service standing in the dock convicted by a jury of misconduct in a public office in circumstances where you have abused your position as a constable to further a sexual relationship.

"You were taking advantage sexually of a woman who you knew to be highly vulnerable and had real difficulties in her life, and who was someone who - if she complained - was unlikely to be taken seriously."

In passing the custodial sentence, Judge Stokes added that he had taken into account the constable's ill health and his resignation from Derbyshire Constabulary.

The judge told Dhanda: "The fact that you have resigned from the police force at long last is at least an indication that you accept that you are in no position to pursue any defence in relation to disciplinary proceedings."