Simon Bowes-Lyon, a relative of the Queen jailed for sexual assault, has been released from prison after serving half of his sentence.
Bowes-Lyon, the 19th Earl of Strathmore and the son of a cousin of Her Majesty, was in February jailed for 10 months.
He pleaded guilty to a late-night sex attack on a guest staying at his ancestral home, Glamis Castle in Angus, about 13 miles north of Dundee.
The assault took place in a bedroom at the 14th-century chateau-style castle in February 2020.
Mr Bowes-Lyon, 35, was released from HMP Perth last week after serving half of his term in jail, it is understood. He was sentenced at Dundee Sheriff Court.
The court heard how 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 from getting back in and was "upset and afraid" and "left shaking", the court heard.
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 spokesperson for Strathmore Estates declined to comment.
A spokesperson for the Scottish Prison Service said it did not comment on individual cases.
Glamis Castle has been the seat of the Bowes-Lyon family since 1372.
It was the Queen Mother's childhood home and Princess Margaret, the Queen's sister, was born in the castle.
Bowes-Lyon was a great-great nephew of the Queen Mother.
Additional reporting by Press Association