Petrie was first arrested in 2009 after one of his victims accused him of threatening behaviour.
He was held in a police station for five hours, but no further action was taken at the time because of a lack of evidence.
In 2023, a second woman accused him of rape, prompting an investigation by specialist sexual crime officers.
Petrie was arrested, charged and suspended in December 2023. He retired from the force a year later.
In September this year he was found guilty at the High Court in Glasgow of eight charges involving sexual and physical assaults against the two women, including four counts of rape.
Assistant Chief Constable Tim Mairs said Petrie had committed “a series of severely abusive, exploitative and violent crimes towards women.
“His offending is in stark contrast to the professionalism and commitment of the officers who investigated him and ultimately helped bring him to justice.”
Mairs said Petrie’s victims had shown great courage in reporting his crimes and that he hoped the sentence would bring them some “closure and comfort”.
He added: “This investigation shows the public that when matters of this nature are reported to us, regardless of who the perpetrator is, victims will be listened to and supported as we take immediate action to identify, investigate and bring to justice those responsible.”
Petrie’s conviction raised fresh questions over background checks on police in Scotland.
