Det Sgt Trevor Gray, 47, had been out for drinks with his victim before the pair shared a cab to her house.

But she said she was shocked when Gray also got out of the taxi and invited him in out of “courtesy” for no more than 15 minutes, before telling him she was tired. Derby Crown Court heard Gray, who denied rape, attempted rape and sexual assault, left her house but hung around in the street.

He sent a text saying “Ur harsh”, then broke in and attacked her as she slept.

Gray, a highly-regarded officer with Nottinghamshire Police, was told by Judge John Wait: “You did not believe she would have the courage to complain.”

The detective, of Watnall, Notts, was also barred from contacting the victim and placed on the sex offenders’ register for life.