Heightened Security in Times Square on New Year's Eve

New York City police officers stand watch in Times Square during New Year's Eve celebrations in New York December 31, 2014. Keith Bedford/Reuters

(Reuters) - Thousands of New York City police officers prepared for protests in Times Square against excessive police force as an enormous crowd of revelers gathered there under unusually tight security for the nation's biggest New Year's Eve celebrations.

In the hours before the giant crystal ball drops at midnight, bomb-sniffing dogs and counterterrorism units joined uniformed officers posted on the streets around the famed Manhattan crossroads. Other officers were stationed on rooftops and at area subway stations.

Security is always tight in Times Square on New Year's Eve, especially since the Sept. 11, 2001, attacks on the World Trade Center. But this year, extra precautions were in being taken after months of protests over the deaths of two unarmed black men at the hands of white police officers in New York and Ferguson, Missouri.

Tensions in New York sharpened nearly two weeks ago when a gunman shot dead two police officers sitting in a patrol car in Brooklyn in an apparent act of retribution against law enforcement.

"In light of what happened two weeks ago, there is a concern for every member of the New York City Police Department," said James O'Neill, an NYPD official. "This is something that's in real recent memory. It's something every cop in New York City is concerned about."

Joining uniformed police, plainclothes officers blended into the crowds that were gathering inside metal-gated corrals set up to control a throng that officials estimate may reach 1 million despite frigid weather.

"People have an absolute right to protest as long as they do it peacefully and laws aren't broken," O'Neill said at a news conference on Tuesday.

Organizers of a protest dubbed "Rock in the New Year with Resistance to Police Murder" handed out signs in Times Square and urged people to form a "flash mob" when the ball drops. They want revelers to pull out placards hidden under their coats and chant "Black Lives Matter!" and "We Can't Breathe!," two rallying cries of protesters.

"New Year's Eve needs to usher in an escalation of resistance to the police murder of black and brown people," said Steve Yip, an organizer with Stop Mass Incarceration Network.

The city denied a parade permit to allow the group to march in the streets from Union Square to Times Square at 10 p.m. EST (0300 GMT), but Yip said he was still fighting for a permit and that protesters might walk the route by sidewalk, which would not require a permit.

Along with usual safety measures like sealing off manhole covers, banning backpacks and halting subway service to Times Square and two other nearby stations, the NYPD has added personnel. Still, authorities said there were no known threats against the city or its officers.

The ambush of the two officers, Wenjian Liu, whose funeral will be held on Sunday, and his partner Rafael Ramos, whose funeral took place last weekend, was carried out by a gunman who vowed to avenge the deaths of Eric Garner in New York and Michael Brown in Ferguson. It deepened the rift between the NYPD and Mayor Bill de Blasio, who had offered qualified support for the protesters.