He was subsequently arrested and is now under investigation by the National Crime Agency (NCA).

Mr Rock – who worked on policy regarding child pornography – has also been the subject of a complaint of alleged “inappropriate behaviour”, according to Downing Street.

“Obviously, when I heard these allegations I was profoundly shocked and remain profoundly shocked today,” Mr Cameron said yesterday during a visit to the Midlands.

“I have to be careful about what I say about this issue because a criminal investigation is under way.”

He said of Mr Rock: “He did play an important role at Downing Street and he’s resigned that position.” Defending the delay in releasing the information, Mr Cameron 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 straightforward answers, which is absolutely the right way to answer this.

“I’ve been clear right along and I was told about this issue pretty much as soon as it was discovered, and I have been very clear we must handle this in an absolutely correct way and I am satisfied that is what No 10 Downing Street has done.”

The Prime Minister’s official spokesman said the complaint against Mr Rock had been dealt with “very seriously” in accordance with human resources policy but declined to give further details.

He would not say whether there was any link to the complaint of inappropriate behaviour or when or where the alleged behaviour took place.

“I can confirm that a complaint around alleged inappropriate behaviour was raised.

“The matter was dealt with very seriously at senior levels in full accordance with the Cabinet Office’s human resources policy,” the spokesman said.

He confirmed that No 10 was first made aware of the alleged offence regarding child abuse imagery on the evening of 12 February.

The matter was immediately referred to the NCA and Mr Rock resigned his position as deputy head of the policy unit.

In the early hours of the morning of 13 February he was arrested at his home in London.

Mr Rock, 62, has been close to Mr Cameron for many years. The two men worked together as advisers to Michael Howard when he was home secretary in the 1990s.

The spokesman confirmed that, prior to his arrest and resignation, Mr Rock had been involved in drawing up government policy on internet porn filters.

“He was one of a number of people working on this issue,” the spokesman said.

He declined to comment on reports that Mr Rock had been in line for a possible peerage.