David Cameron says he is "profoundly shocked" by allegations against a senior Downing Street aide involving child abuse images,

No 10 disclosed last night that Patrick Rock resigned last month after officials were made aware of a potential offence.

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

Mr Rock has also been the subject of a complaint of alleged "inappropriate behaviour", Downing Street has said.

"Obviously when I heard these allegations I was profoundly shocked and remain profoundly shocked today," Mr Cameron said 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 told reporters: "H e did play an important role at Downing Street and he's resigned that position."

Defending the delay in releasing the information, 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 questons 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 the Cabinet Office's 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.

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

The matter was immediately referred to the National Crime Agency (NCA) and Mr Rock resigned his position as deputy head of the policy unit. In the early hours of the morning of February 13 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.

Mr Rock has been an influential figure behind the scenes in the Conservative Party for decades.

In the 1970s, he was credited with coining the Tory slogan "Cows moo, dogs bark, Labour puts up taxes".

In 2011 he was drafted in by Mr Cameron to beef up the Downing Street policy unit as a key driver of Government decision-making.

He was caught out last year when he was photographed entering No 10 carrying a confidential document identifying the Government's "problematic areas" and "broken promises".

He stood unsuccessfully for Parliament on three occasions in the 1979 and 1983 general elections and the Portsmouth South by election in 1984.

Mr Cameron's official spokesman later said that the harassment allegation was "in no way related to the arrest" over the alleged child abuse images.

"The issue was appropriately resolved with the consent of and in consultation with the individual who raised the issue," said the spokesman, who declined to say whether the complainant was male or female or give any further information which might identify the person involved.

Asked if Mr Cameron was aware of the complaint of inappropriate behaviour at the time it was made, the spokesman told reporters at a regular Westminster media briefing: "The Prime Minister is always kept informed about relevant staff issues."

Mr Cameron has not spoken to Mr Rock since the allegations relating to alleged child abuse images were made, said the spokesman.

Asked if the PM regarded Mr Rock as a "friend", the spokesman said: "He regards him as someone who had long-standing experience in government and politics with whom he worked closely in previous roles."

The spokesman confirmed that officers from the National Crime Agency visited Downing Street and that Number 10 arranged for them to have access to all offices and information technology which they considered relevant to their inquiries.