In an indication of the power and privilege extended to Savile by the royal family, Charles asked the DJ and television presenter for advice before selecting Sir Christopher Airy to be his private secretary in 1990.
Savile and Charles met Airy, a former major-general, before he was offered the post, according to an informed source.
The revelation shows the close friendship between the heir to the throne and the television presenter, who the prince grew to rely on in the late 1980s and early 1990s.
It also raises questions about the judgment of Charles and his decision to befriend Savile, who is now believed to have abused as many as 300 child victims.
Another source, who asked not to be named, said: “Savile was in and out of the palace at that time pretty frequently. His bling and his tracksuits made him rather unconventional and I think that was appealing to Prince Charles.
“Like the fool in King Lear, he was allowed to say things to Prince Charles that other courtiers weren’t.”
The two men became unlikely friends after meeting in the late 1970s while working with wheelchair sports charities. Former palace aides have described how Savile inveigled his way into the royal family, dropping in to see Charles when it suited him.
While the prince seemed amused by Savile’s eccentricity, Diana, Princess of Wales seemed more cautious.
Ken Wharfe, her former protection officer, said: “Savile used to just turn up at Kensington Palace and at functions.
“When Diana was carrying out an engagement around the country he would just turn up out of the blue like it was the Jimmy Savile visit rather than the Princess Diana visit.
“I don’t think Diana was a great fan of his in the way that the Prince of Wales was.”
Despite this, the friendship between Charles and Savile grew closer over the years, in part due to Savile’s charity work. He was invited to Charles’s 40th birthday party in 1988 and when Charles received a gift of cigars from Fidel Castro, he passed them on to Savile.
In 1990, Charles brought Savile into his home in an attempt to help smooth over his relationship with Diana when it became clear their marriage was beginning to fall apart.
Dickie Arbiter, the former press secretary to the Queen who also handled media relations for the Prince and Princess of Wales, said Savile used to arrive at the palace and kiss female workers on the hand before rubbing his lips all the way up their arms if they were wearing short-sleeved shirts.
Arbiter said: “Savile was brought in by an aide as a sort of ‘Jim’ll fix it’ to fix the state of the marriage, but of course it didn’t work.
“His role was informal, ad hoc. He would just roll in and roll out again. I thought he was a pretty ghastly man.”
Charles even dispatched the presenter to help the Duchess of York keep a low profile as her marriage to his brother Prince Andrew deteriorated.
Princess Diana was recorded telling James Gilbey on the so-called Squidgygate tape: “Jimmy Savile rang me up yesterday, and he said ‘I’m just ringing up, my girl, to tell you that His Nibs [Prince Charles] has asked me to come and help out the redhead [the Duchess of York], and I’m just letting you know, so that you don’t find out through her or him; and I hope it’s all right by you.”
Savile’s tasks also included helping Charles pick his private secretary. After consultation with Savile, Airy was appointed private secretary and treasurer to the prince and Diana.
When asked about the matter, Airy said: “I don’t think it is my place to comment.”
St James’s Palace said there was “no record” of Savile being present at Airy’s interview.
The relationship between Charles and Savile developed and in 1999 Charles accepted an invitation to dinner at Savile’s home in Glencoe where he was served by three women wearing aprons that spelt out “HRH”.
He later showed his appreciation in a Christmas card to Savile, writing: “Jimmy, with affectionate greetings from Charles. Give my love to your ladies in Scotland.”
On his 80th birthday, Charles reportedly sent Savile a box of cigars and a pair of gold cufflinks and a note that read: “Nobody will ever know what you have done for this country Jimmy. This is to go some way in thanking you for that.”
When Savile died last year, Charles led the tributes to him, saying his death had left him “incredibly saddened”.