Khalid Anwar raped the woman in a property in Tillicoultry, Clackmannanshire, and then assaulted and threatened her months after the rape, bombarding her with vile texts and emails.
Anwar, 41, was convicted after a trial at the High Court in Glasgow. His 44-year-old victim told the jury she and Anwar had consensual sex four times, but then on a further occasion, in October 2011, she had not given her consent and he had raped her.
Yesterday, at the High Court in Edinburgh, Lady Scott sentenced him to four years in prison. He had already been placed on the Sex Offenders' Register.
Defence advocate Sarah Livingstone told the court that Anwar, who at the time of the offence was a serving officer with the then Lothian and Borders Police force, had accepted the fact he was being sent to prison.
She said: "He accepts the decision of the jury and he accepts he will be sent to prison for this offence.
"He has been a useful member of society. He has an unblemished record - all of that has been lost to him, absolutely lost to him.
"In my respectful submission, he does not pose a threat to the public."
Anwar, of Edinburgh, had denied the charges against him and claimed the woman had consented to sex. During the trial, he branded his victim "volatile" and claimed she could "blow up like a volcano".
The court heard about text messages exchanged between the pair after the attack. One sent by her included the words: "I'm annoyed you carried on when I asked you not to." Anwar replied in which he made reference to the woman having "enjoyed it, but in a painful way".
The officer was accused of then harassing his victim, which included him sending a vile text and threatening to pin up naked pictures of her at work and on her street. He was convicted of a charge of engaging in a course of conduct that left the woman in "fear and alarm".
Nicola Patrick, Procurator Fiscal High Court for the East of Scotland, said: "Prosecutors take the crimes of rape and sexual offences extremely seriously and are committed to ensuring all such cases are investigated thoroughly and prosecuted appropriately.
"Victims can have confidence their cases will be handled by specialists, who are committed wherever possible to bringing those who commit sexual offences of any kind to justice."