There is never a good time for the proverbial "bad penny" to turn up, so imagine how the Queen received news of the arrest of Ghislaine Maxwell and her appearance in court on sex-trafficking charges.
Maxwell was once a welcome visitor to royal homes, an overnight guest at Sandringham as well as being invited to one of the starriest parties ever thrown at Windsor Castle, the so-called Dance of the Decades in the summer of 2000.
Nor was that her only invitation to royal glamour at Windsor. In 2006 she was a guest at Princess Beatrice's lavish costume ball to mark her 18th birthday.
On another occasion the vivacious socialite was photographed at Prince Andrew's side in the Royal Enclosure at Ascot, where admission is at "Her Majesty's discretion".
Yesterday, with the Queen still in lockdown with Prince Philip at Windsor, there must have been the iciest of feelings at the news that the daughter of disgraced media tycoon Robert Maxwell had been taken into custody.
As a mother, Her Majesty will, of course, be anxious about what Maxwell's arrest and her knowledge of the alleged activities of paedophile financier Jeffrey Epstein mean for her son.
And as monarch there will be anger at the prospect of the good name of the Royal Family being dragged through the mud once again.
No family matter has concerned her more than the shadow hanging over Andrew. To her, it is infinitely more serious than the selfish trivialities of the exiled Prince Harry and the Duchess of Sussex.
For more than seven months it has been an ongoing crisis, with every sordid revelation lapping that bit closer to Buckingham Palace.
Ever since that Newsnight interview in which Andrew spectacularly failed to offer any sympathy for Epstein's victims and showed no remorse over his friendship with the billionaire sex offender, fears about the implications for the Prince have multiplied.
Maxwell's arrest changes everything. She, remember, is in the famous photo of Andrew with his arm around the bare midriff of teenager Virginia Roberts — a picture of which the Duke of York has no recollection — which was taken by Epstein in Maxwell's Belgravia home.
Does she really believe Andrew's insinuations that the photo was doctored or manipulated?
Then there is the most damaging claim of all from Roberts, who says that, aged 17, she and Andrew had sex three times. The Prince denies it.
If anyone knows the truth it must be Maxwell, whom Andrew befriended during visits to New York after his divorce from the Duchess of York.
It was through Maxwell that Andrew was introduced to Epstein, who was found dead in his New York prison cell a year ago. And on all those social occasions — including Beatrice's party — where Maxwell was a guest of Andrew, so, too, was Epstein.
As the Royal Family and their advisers have agonised over how best to protect the integrity of the monarchy from the fallout of the Epstein affair, there may be some slim consolation.
The charges brought by the FBI against Maxwell relate to a period in the mid-1990s — before Prince Andrew had ever met the sleazy Epstein.
Perhaps more significantly, the decision to strip Andrew of all royal duties and force him to step down from official engagements looks even more of a wise move.
With the benefit of hindsight, the prompt action — brokered by Prince Charles and Prince William — has been the only moment when the royals have been on the front foot. Andrew's stubborn failure to sever contacts with Epstein after he was first accused of under-age sex offences, was the major contributor to his own downfall.
He did, belatedly, end up cutting ties with him — but only after he was photographed walking with the financier in Central Park, New York.
Yet he continued to keep up his friendship with Maxwell, the woman who brought them together and who was described as "Jeffrey's pimp".
Although the relationship between the two was said to be platonic, their lives were so intertwined that Fergie was reported to have become concerned that Maxwell was exerting an unhealthy influence on him. Even so, the two remained friends.
In the Newsnight interview, Andrew admitted he had seen Maxwell last year. The meeting, he said, was before Epstein's arrest on sex-trafficking charges last July and that they did not discuss the billionaire. He said: "There wasn't anything to discuss because he wasn't in the news."
Epstein and Maxwell met in New York, where she had set up home after the death of her father, who fell from his yacht and drowned in 1991.
She was a pivotal figure on the New York social scene.
"Great fun, always was, still is," said a friend. "I'm not at all surprised that Prince Andrew likes her. She is full of energy, full of plans.
"She would ring and say: 'Ten of us are going to a restaurant then a club. Do come, it will be fun.' She was persuasive, too, and Andrew loved that."
By 2000 Maxwell and Andrew, who were introduced by the Duchess when she was a regular fixture on the New York party circuit, were very close.
But they were not a couple. She would even introduce him to future girlfriends, such as Emma Gibbs. They were often seen together in public.
The pair caused a minor stir when they made an appearance at a Ralph Lauren launch in the city. One source observed: "They certainly seemed to have a good time together."
Andrew was also a regular guest at the dinner parties she would hold at the home of Epstein, who was by then her ex-boyfriend, on the Upper East Side.
Such was the importance of the role Maxwell played in Andrew's life that it was even claimed he once asked the Queen's permission to take her on an official work trip. This was refused.
Andrew was widely criticised after he appeared with Maxwell at a "pimps and prostitutes" theme party thrown by the model Heidi Klum.
To his ex-wife, such behaviour was beginning to damage his reputation. She was also concerned at the effect it would have on their daughters.
In 2001, when Andrew was about to take up his role as Britain's trade envoy, a friend of the Duchess told the Mail on Sunday: "Fergie and a lot of other people who love Andrew believe his friendship with Ghislaine Maxwell and Jeffrey Epstein has become really dangerous. They're using him just for his name and access and he is so innocent he doesn't realise."
How prophetic those words were to become. Among courtiers there is considerable anxiety about what Maxwell's arrest means for the Duke of York. They believe that such is her intimate knowledge of Epstein, she could damn Andrew or clear him.
For Andrew, his reputation is gone — but for the Queen at 94, this latest twist to one of the most unpalatable episodes of her reign can only be troubling.