The "secret" documents clutched by Mr Quick were clearly on show
Britain's top counter-terrorism officer has quit after admitting he could have jeopardised an operation to thwart a possible UK al-Qaeda terror plot.
Assistant Commissioner Bob Quick resigned after he accidently revealed a secret document to photographers.
Police were forced to bring their operation forward and arrested 12 men - 11 of whom are Pakistanis.
Gordon Brown said Mr Quick had said sorry for what went wrong and he had thanked him for his long service.
The prime minister also said Pakistan's government "had to do more" to root out the terrorist elements in its country.
Sources say the planned attack was to be "very soon" and "very, very big".
'Lives at risk'
Former home secretary David Blunkett has questioned whether there should be tighter controls on photographers outside Number 10.
The Labour MP for Sheffield Brightside told BBC Radio 4's PM programme it was right to ask what restrictions may have to be introduced.
He said: "I have got to ask the question... is it appropriate when we are talking about security, safety, when we are talking about the revelation from a photograph, that we should have that carrying on in Downing Street in quite the same way?"
He added he did not blame photographers for Mr Quick's resignation but that he had paid a "terrific price" for his "foolish" mistake.
After announcing he was to quit his post, Mr Quick said: "I have today offered my resignation in the knowledge that my action could have compromised a major counter-terrorism operation.
"I deeply regret the disruption caused to colleagues undertaking the operation and remain grateful for the way in which they adapted quickly and professionally to a revised timescale."
The senior Metropolitan Police officer has faced intense criticism from opposition politicians after revealing the confidential document to photographers after arriving for the Number 10 briefing in his anti-terrorism role and for the Association of Chief Police Officers.
The memo, marked "secret", carried an outline briefing on an ongoing counter-terror operation.
It contained the names of several senior officers, locations and details about the nature of the overseas threat.
Mayor of London Boris Johnson said it was "with great sadness" that he had accepted Mr Quick's resignation.
He told BBC Radio 4's Today programme the senior officer had a "very, very distinguished" career and that the memo incident had been "extremely unfortunate".
The mayor confirmed Assistant Commissioner John Yates would replace Mr Quick as head of counter-terrorism.
A man was arrested at Liverpool John Moores University
Metropolitan Police Commissioner Sir Paul Stephenson paid tribute to Mr Quick who he said had "served with dedication and professionalism throughout his career".
"I hold Bob in the highest regard, as a friend and colleague, and that opinion has not changed," he said.
In a statement, Home Secretary Jacqui Smith said she had been informed of Mr Quick's resignation by Sir Paul.
"Although the operation was successful, he felt that his position was untenable. I want to offer my sincere appreciation of all the outstanding work he has done in this role," she said.
Shadow home secretary Chris Grayling said resigning was "the right thing to do".
"The bit I don't understand is, why on earth a document like this is not locked in a briefcase as a matter of routine? I'd have just thought it would be blindingly obvious."
Liberal Democrat home affairs spokesman Chris Huhne agreed that such a "misjudgement" meant Mr Quick had to step down.
Eleven of those arrested in the police anti-terror operation are Pakistan-born nationals on student visas and one is a UK-born British national. Their ages range from a teenager to a 41-year-old, police said.