A relative of Queen Elizabeth II was sentenced Tuesday to prison for sexually assaulting a woman in Scotland.

Simon Bowes-Lyon, the Earl of Strathmore, had admitted assaulting the woman in a bedroom at Glamis Castle in February 2020. He has been sentenced to 10 months in prison.

Bowes-Lyon, 34, who is a first cousin twice removed of the queen, pleaded guilty last month, saying he was "greatly ashamed of my actions which have caused such distress to a guest in my home."

QUEEN ELIZABETH’S RELATIVE, EARL OF STRATHMORE, PLEADS GUILTY TO SEXUALLY ASSAULTING A WOMAN: REPORTS

"I did not think I was capable of behaving the way I did but have had to face up to it and take responsibility," he said.

A relative of Britain's Queen Elizabeth II has been sentenced to 10 months behind bars for sexual assault. (AP Photo/Alastair Grant)

He was sentenced Tuesday at Dundee Sheriff Court.

Glamis Castle, near Dundee in central Scotland, is the childhood home of the queen’s late mother, who was born Elizabeth Bowes-Lyon.

Bowes-Lyon is also the great-great nephew of the Queen Mother, who passed away in 2002 at age 101.

CLICK HERE TO SIGN UP FOR OUR ENTERTAINMENT NEWSLETTER

Simon Bowes-Lyon, the Earl of Strathmore, arrives at Dundee Sheriff Court ahead of sentencing, in Dundee, Scotland, Tuesday, Feb. 23.  (Jane Barlow/PA via AP)

Bowes-Lyon was hosting an event at the 16,500-acre estate at the time of the attack, the U.K.’s Daily Record previously reported.

CLICK HERE TO GET THE FOX NEWS APP

According to the outlet, he forced his way into the sleeping woman’s room, tried to pull off her nightgown, groped her and then assaulted her for more than 20 minutes.