David Cameron has defended his handling of the arrest of his aide Patrick Rock over an alleged offence related to child abuse images, as it emerged the adviser was subject to a complaint about "alleged inappropriate behaviour" during his time at Downing Street.

The prime minister said he was "profoundly shocked" by allegations against Rock, who had worked on government policy about placing filters on internet pornography to protect children.

Downing Street is facing questions about why it kept Rock's arrest secret and appears to have allowed him to find out about the allegations before the police arrived at his home.

Defending the delay in releasing the information, 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."

He added: "I have to be careful about what I say about this issue because a criminal investigation is under way. He did play an important role at Downing Street and he's resigned that position."

On Tuesday, the prime minister's official spokesman revealed that Rock was the subject of a complaint about "alleged inappropriate behaviour" during his employment at No 10, but declined to say whether this was linked to the current accusations, what the exact timing of his resignation was, and how Cameron found out about the allegations.

The spokesman defended the decision not to be proactive about revealing the arrest or resignation of Rock before a newspaper asked questions, saying it would not have been appropriate.

He refused several times to confirm whether Rock was confronted about the allegations before the police were alerted, saying only that Downing Street had informed the National Crime Agency (NCA) immediately. However, he did say Rock resigned on 12 February and was not arrested until the early hours of 13 February.

The spokesman also refused to reveal whether the allegation of inappropriate behaviour had been dealt with by Ed Llewellyn, Cameron's chief of staff and an old friend of Rock.

"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.

Rock was arrested at his west London flat the morning after Downing Street was first made aware of the potential offence. Officers from the NCA subsequently examined computers and offices used in Downing Street by Rock, who was the deputy director of No 10's policy unit.

Tom Watson, a senior Labour MP who is calling for a public inquiry into the child abuse allegations, 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."

No 10 confirmed on Monday evening that Rock had been arrested after being approached by the Daily Mail. A spokesman said: "On the evening of 12 February, Downing Street was first made aware of a potential offence relating to child abuse imagery. It was immediately referred to the National Crime Agency (Ceop).

"The prime minister was immediately informed and kept updated throughout. Patrick Rock was arrested at his home in the early hours of 13 February, a few hours after Downing Street had reported the matter. Subsequently, we arranged for officers to come into No 10 and have access to all IT systems and offices they considered relevant.

"This is an ongoing 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."

The arrest of Rock, 62, who had been tipped for a Tory peerage, will have come as a severe shock to the prime minister and the Tory establishment. Cameron and Rock worked together as special advisers to Michael Howard in his time as home secretary in the mid 1990s. Rock later worked for Lord Patten alongside Llewellyn, during his time as a European commissioner in Brussels.

Rock was never a member of Cameron's innermost circle, whose members are closer to the prime minister's age. But he was a respected and trusted figure who shared Cameron's sense of humour.

The Daily Telegraph columnist Benedict Brogan recalled in 2011, when Rock started working in No 10, that he and Cameron repaired to the Two Chairmen pub on the day John Smith died in 1994.

"We both agreed that Blair coming meant that we would be fucked," he was quoted as saying. Brogan also wrote that Rock coined the phrase: "Cows moo, dogs bark, Labour put up taxes."

Rock helped to draw up the government policy that led to the deal on the use of online filters with the large internet firms. Under the deal, all households connected to the internet will be contacted to be asked if they would like the filters installed.

Rock faced embarrassment last year when he was photographed walking up Downing Street clutching a document outlining progress on hundreds of pledges made by the coalition. Ed Miliband said the document, which admitted that some of the 399 pledges had not been met, was an "audit of coalition broken promises".