LONDON — Britain’s top counterterrorism official resigned Thursday after committing an embarrassing breach of security that forced police to prematurely mount a sting operation against suspected al-Qaeda plotters.

Bob Quick, an assistant commissioner at Scotland Yard, apologized for having potentially jeopardized “a major counterterrorism operation” when he was photographed and filmed Wednesday carrying top-secret documents in plain view.

Clutched under his right arm as he arrived at 10 Downing Street for a briefing was a memo, titled “Operation Pathway,” whose contents about an ongoing terrorist investigation were clearly legible on camera.

Hours later, police fanned out across northwest England and arrested a dozen men in armed raids that, in some cases, occurred in public places in daylight, terrifying bystanders. Police said that 11 of the 12 detainees were Pakistani nationals, some of them in Britain on student visas.

Police divulged no further details about the suspects or what exactly led to their arrests, although the size and complexity of the sting, which involved hundreds of officers, suggest the men had been under surveillance for some time. There were unconfirmed reports Thursday that authorities suspected a large-scale attack to be in the final stages of planning, perhaps a bombing on a nightclub or shopping center.

“We’re dealing with a very big terrorist plot. We’ve been following it for some time,” Prime Minister Gordon Brown told the British Broadcasting Corp. “We had to act pre-emptively to ensure the safety of the public.”

Quick, a 30-year police veteran, acknowledged his blunder in a statement, saying he regretted “the disruption caused to colleagues” and was “grateful for the way in which they adapted quickly and professionally to a revised time-scale.”