An adviser to David Cameron arrested over allegations of child abuse images had also been accused of harassing a Downing Street colleague, Number 10 has confirmed.
Patrick Rock, who had been involved in drawing up proposals for internet porn filters, resigned hours before being detained by police officers on 13 February.
The episode has dismayed Downing Street as Mr Rock, who was deputy head of its policy unit, was among the Prime Minister’s longest-standing political friends.
Mr Cameron spoke of his “profound shock” at discovering the allegations against his adviser and also defended his handling of the incident.
The 19-day delay in confirming the police investigation, Mr Rock’s resignation and a search of Downing Street computers by detectives has led to accusations of a cover-up by the Government.
The 62-year-old adviser had also been the subject of a harassment complaint from a civil servant, it emerged.
Mr Cameron’s official spokesman confirmed a “complaint around alleged inappropriate behaviour” was passed to Ed Llewellyn, the Prime Minister’s chief of staff.
He said it was dealt with “very seriously at senior levels” in accordance with the Cabinet Office human resources policy and resolved to the complainant’s satisfaction. Mr Cameron was kept fully informed of the incident.
He refused to go into further details, but added: “The harassment case is in no way related to the arrest.”
Mr Rock, 62, who worked for the Thatcher and Major governments, got to know Mr Cameron in the mid-1990s when they both worked for Michael Howard when he was Home Secretary.
The Prime Minister brought him into Downing Street in 2011 to work in the Number 10 policy unit. He took responsibility for home affairs issues and was among officials working on proposals for toughening controls on internet images of child abuse.
The policy was being drawn up after Mr Cameron challenged internet service providers to install family-friendly filters on home computers.
Downing Street has said it was made aware of a “potential offence relating to child abuse imagery” on 12 February and immediately alerted the National Crime Agency, which handles major investigations into child pornography.
It was not clear why the agency, rather than the Metropolitan Police, was called in.
Mr Rock was arrested at his home in west London early the following day. He has not been charged.
Later, detectives working on the case were given full access to Downing Street computer systems and offices which he might have used.
The Prime Minister said: “Obviously when I heard these allegations, I was profoundly shocked and remain profoundly shocked today.”
Defending the delay in releasing information about the arrest, he said: “I don’t think it would be right to pre-emptively brief out a criminal investigation and that’s why we did not do that.
“But as soon as questions were asked, as questions would inevitably be asked, we have given very full and straight-forward answers, which is absolutely the right way to answer this.”
The Labour MP John Mann condemned a “lack of transparency” over the case.
He said: “It is highly inappropriate that a major figure should cease to be responsible for these policy areas without MPs and the public being made aware.”
The former Labour minister Tom Watson said: “There is a duty of care to Mr Rock, who has not been charged with anything as of today, yet I do think it is not unreasonable for Downing Street to explain why he resigned hours before the police appear to have acted.”
A Downing Street spokesperson said: “This is an on-going investigation so it would not be appropriate to comment further.
“But the Prime Minister believes that child abuse imagery is abhorrent and that anyone involved with it should be properly dealt with under the law.”
Profile: Patrick Rock
Patrick Rock’s involvement with the Conservative party at the most senior levels dates back to the 1970s.
Born of aristocratic stock, he went to work as Margaret Thatcher’s correspondence secretary after graduating from Oxford University.
He stood several times for Parliament and even lost the previously safe Tory seat of Portsmouth South after a disastrous by-election campaign in 1984.
Afterwards he received a personal telephone call from the Prime Minister to reassure him it was not his fault.
Although he never achieved his ambition of becoming an MP, he arguably wielded far more influence in a series of backroom jobs.
In the 1990s he worked as special adviser to Cabinet Ministers Chris Patten and Michael Howard. In the latter job he encountered David Cameron and formed a strong bond with the ambitious young Tory.
Mr Rock built a strong rapport with journalists and was widely regarded as one of the most effective operators in John Major’s doomed government.
Mr Cameron brought him back into Downing Street three years ago and until last month Mr Rock appeared to be heading for a peerage.