In January, several days after heavily armed terrorists attacked Charlie Hebdo, a satirical newspaper in Paris, top officials with the New York Police Department held a drill to test the city’s response to such an attack and found they had a problem.

As officers converged on 42nd Street in Manhattan near the United Nations headquarters, some took nearly an hour to get there. Others coming from plainclothes organized-crime and narcotics units in far-flung precincts in Brooklyn and Queens, did not look the part: street clothes, facial hair, semiautomatic weapons that did not match those being carried by colleagues in uniform.

“One of the observers said they look a little too much like the bad guys,” John J. Miller, the deputy commissioner for intelligence and counterterrorism, said, describing the drill.

Out of that moment came the formation of a standing counterterrorism force whose initial platoon of 100 officers rolled out on Monday and whose ranks will swell to 527 officers by the end of the year, much bigger than any of the ad-hoc units that the department has deployed in the years since the Sept. 11 attacks. The new unit, composed of experienced officers, was made possible in part by an expansion of the overall head count in the department this year.