The News of the World told a private detective he had to "become a journalist" after the paper's royal editor was arrested for phone hacking, the press standards inquiry has heard.
Investigator Derek Webb has claimed he was hired by the Sunday tabloid to carry out surveillance on prominent figures including Princes William and Harry, former attorney general Lord Goldsmith, and the parents of Harry Potter actor Daniel Radcliffe.
He alleges that a senior News of the World executive told him he had to "stop being a private detective" and join the National Union of Journalists (NUJ) after police arrested journalist Clive Goodman in 2006, the Leveson Inquiry was told.
NUJ general secretary Michelle Stanistreet said Mr Webb approached the union after the News of the World was closed in July following public outcry over the hacking of murdered schoolgirl Milly Dowler's phone.
Ms Stanistreet told the inquiry in an opening submission: "Mr Webb was hired as a private detective by the News of the World and carried out surveillance for the company for many years.
"However, he alleges that, in the wake of the arrest of the paper's royal editor, Clive Goodman, he was taken aside by a senior executive on the News of the World and told he had to 'stop being a private detective and become a journalist'.
"The same executive also apparently told him he must join the NUJ and acquire an NUJ press card. This he duly did.
"For the NUJ this is a breathtakingly cynical move on behalf of the News of the World."