Simon Bowes-Lyon, 35, the Earl of Strathmore, was sentenced to 10 months in February for the late-night attack on a guest staying at Glamis Castle in Angus, his ancestral home.
Bowes-Lyon, the son of a cousin of the Queen, is understood to have been released from HMP Perth last week after serving half his sentence.
He was sentenced at Dundee Sheriff Court after pleading guilty to the assault, which happened in a bedroom at the castle 12 months earlier in February 2020.
The court heard the victim was attending a three-day public relations event at the 16,500-acre estate and had gone to bed when a “drunk” Bowes-Lyon went to her room at around 1.20am.
He persuaded her to open the door before pushing her on the bed and sexually assaulting her in a 20-minute ordeal.
His victim locked the bedroom door and wedged a chair under the handle to prevent him getting back in and was “upset and afraid” and “left shaking”, the court heard.
A spokesman for the Scottish Prison Service said it did not comment on individual cases.
In a statement outside court, Bowes-Lyon apologised and said he is “greatly ashamed of my actions which have caused such distress to a guest in my home”.
He said he had “drunk to excess” on the night of the attack but acknowledged it was “no excuse” for his actions.
He added: “I did not think I was capable of behaving the way I did but have had to face up to it and take responsibility.
“This has involved seeking and receiving professional help as well as agreeing to plead guilty as quickly as possible.”
Glamis Castle is the seat of the earls of Strathmore and Kinghorne, part of the late Queen Mother’s family.
A spokesman for Strathmore Estates declined to comment.