Sarah Ferguson, the Duchess of York, shared a meaningful message after the death of her close friend and former mother-in-law.

Ferguson, who was married to the Queen's son, Prince Andrew, posted a statement on her Twitter account expressing her heartbreak.

"She leaves behind an extraordinary legacy: the most fantastic example of duty and service and steadfastness, and a constant steadying presence as our head of state for more than 70 years," Ferguson wrote.

She also noted that the queen "has given her whole life selflessly to the people of the UK & the Commonwealth," before touching upon just how close the two were and how much the queen meant to her.

QUEEN ELIZABETH II REMEMBERED AS KING CHARLES III ASCENDS THE BRITISH THRONE

"To me, she was the most incredible mother-in-law and friend. I will always be grateful to her for the generosity she showed me in remaining close to me even after my divorce," Fergie continued. "I will miss her more than words can express."

Princess Diana Sarah Ferguson

Sarah Ferguson, also known affectionately as Fergie, alongside the late Princess Diana in the '90s. (Getty)

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Ferguson, 62, was married to Andrew, the Queen’s second son, from 1986 to 1996, and they share two children together — Princess Beatrice and Princess Eugenie. 

Despite their highly publicized divorce, the couple has remained close, and they continue to raise their daughters together.

Queen Elizabeth and Sarah Ferguson

Queen Elizabeth II and Sarah Ferguson  (Getty Images)

Throughout the years, Fergie paid her respects to the queen with a special gesture: a deep curtsy. At events like the Royal Ascot, the Duchess of York would greet the Queen with a curtsy and also would sit next to her in the royal box.

In 2021, Ferguson expressed her gratitude for the queen while appearing on an episode of the "Tea with Twiggy" podcast, calling the monarch of 70 years her "greatest mentor" and the "person who believes in me."

Prince Andrew and his then-wife Sarah Ferguson and their two daughters, Eugenie, bottom left, and Beatrice on February 19, 1999.

Sarah Ferguson and Prince Andrew share two daughters together. (AP)

CLICK HERE TO GET THE FOX NEWS APP

"I absolutely admire the incredible way Her Majesty is so modern ... and how flexible, and how understanding, and how forgiving and how generous," she said. 

"I think to myself that, honestly, my mother-in-law has been more of a mother to me than my mother."