A man posted an intimate video of himself with a woman on a pornographic website.
The woman didn't know anything about it until a friend spotted it nearly three years later.
Michael Osbourne's behaviour was branded "despicable" at Hamilton Sheriff Court this week.
Osbourne, 36, of Newlands Drive, Hamilton, admitted uploading the video without the woman's consent in July 2017.
Mohammad Sarwar, prosecuting, said that a few days beforehand he had warned the woman what he planned to do.
However, she was unaware it was online until a friend contacted her in April 2020.
Mr Sarwar told the court: "The website was available for the general public to view."
Defence agent Vincent McGovern said it wasn't Osbourne's first offence involving a female and he would benefit from a domestic abuse education programme.
Sheriff Linda Nicolson told Osbourne: "This offence was simply despicable and you should be thoroughly ashamed.
"I was considering a custodial sentence, but am just persuaded that I can impose an alternative."
Osbourned was placed under supervision for two years and must attend an abuse programme.
**Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here.
And did you know Lanarkshire Live is on Facebook? Head on over and give us a like and share!