Princess Diana leaked a confidential book of royal contact details to a former News of the World reporter, the Old Bailey has heard.
Clive Goodman, who was jailed in 2007 for phone hacking, told the court the former Princess of Wales gave him the book of royal directories while he was working at the now defuct newspaper in 1992.
Goodman claimed she gave him the book to try to embarrass Prince Charles over the "scale of her husband's household".
He added that she even rang him later on to check that he had received it.
Goodman told the court Diana had a "very close" relationship with several journalists and she wanted an ally on her side to take on Charles during the sparation process.
Goodman told the jury that she wanted "to show there were forces that would rage against him [charles]" and sent the information in an envelope to his office.
"She was in a very bitter situation with the Prince of Wales at the time," Goodman added.
"She felt she was being swamped by the people close to him and she was looking to take him on."
The former royal editor at the NotW also said he was handed several copies of the directory through the years, two of which were given to him by a former valet to Prince Charles.
He denies any of them came from public officials.
Goodman is one of several people on trial on phone hacking charges, along with former News of the World executives Rebekah Brooks and Andy Coulson.
He denies two counts of conspiracy to commit misconduct in a public office.