Downing Street communications chief Andy Coulson has quit after admitting the News of the World phone-hacking row was making his job impossible.
In a personal statement issued by Number 10, Mr Coulson said the drip-drip of claims about illegal eavesdropping under his editorship meant he could not "give the 110% needed".
"I stand by what I've said about those events but when the spokesman needs a spokesman it's time to move on," he added.
The Prime Minister said he was "very sorry" that Mr Coulson felt "compelled" to go after months of intense pressure, and thanked him for his "complete professionalism" over the past three and a half years.
But critics insisted the resignation was "long overdue", and questioned Mr Cameron's judgment in recruiting the former journalist in the first place.
The timing also sparked accusations that the Government was trying to "bury bad news" while Tony Blair was appearing at the Iraq Inquiry, and with the furore over shadow chancellor Alan Johnson's departure still raging.
Last week Mr Cameron refused to confirm or deny reports that his communications director had offered to resign to spare the coalition further damage. But he conceded that Mr Coulson was "extremely embarrassed" about claims that he knew famous people's phone voicemails were being accessed.
It is believed Mr Coulson informed Mr Cameron of his intention to leave on Wednesday. No decision has yet been taken on a replacement.
Mr Coulson resigned as editor of the News of the World in 2007 after the paper's former royal editor Clive Goodman and private investigator Glenn Mulcaire were jailed for phone hacking.
Although he accepted ultimate responsibility for the illegal activities, he has always denied knowing they were taking place. A Scotland Yard investigation resulted in no further charges. But a number of public figures are still taking civil legal action against the newspaper, and documents disclosed in those cases have sparked fresh developments.