A former army cadet instructor has admitted sexually assaulting a young woman.
Callum Stewart preyed on his victim over a period of four years before she eventually confided in a relative.
A judge heard how Stewart had also once threatened her that he would circulate a photograph of the abuse.
The 42-year-old was later found to have a stash of 17,000 indecent images of children.
Stewart admitted to a string of sex charges when he appeared at the High Court in Glasgow on Tuesday.
The court was told Stewart was a sergeant at the time at the Army Cadet Force in Carnoustie, Angus.
He first attacked his victim in 2007 when she was aged 19.
The young woman left the court in tears as prosecutor Shirley McKenna narrated the details of the abuse.
The court heard how Stewart once told the victim that he was no longer having sex with his wife and was "considering elsewhere" to get his kicks.
Miss McKenna said Stewart became "more controlling" over the victim.
He asked could he take photos of what he was doing and the young woman agreed hoping it would end her ordeal.
But, the abuse continued and he later forced her to carry out a sex act on him.
In September last year, Stewart sent her a still image of that incident.
The court was told Stewart was "threatening" and said the photo would be "left open for others to see".
Stewart also sent a sinister message to the young woman's boyfriend stating: "Break up with her or I will get you if its the last thing I do."
The victim eventually revealed to a relative her ordeal which lead to Stewart being arrested.
Police subsequently discovered around 17,000 child porn images that he had stored.
Matthew Jackson, defending, said: "This man is well aware that there will be no alternative to a custodial sentence."
Stewart is also believed to have since resigned from the cadets.
Judge Lady Stacey deferred sentencing until next month for reports.
People who read this story also read
- Man accused of killing friend in boating incident 'had been drinking lager'
- Two men accused of walking naked across Tay Road Bridge
- Fashion workshops proving a hit with budding young designers
- Skin cancer: Diagnosis of deadly form of disease triples in over-50s
- Scotsman's body found at Brighton flat two months after he was murdered