NEW YORK -- More than 5,000 police officers will flood midtown Manhattan around the Election Day gatherings for Democrat Hillary Clinton and Republican Donald Trump and elsewhere in a show of force meant to keep the peace at the end of a contentious presidential campaign, city officials said Monday.

At a news conference in Times Square, Mayor Bill de Blasio and top New York Police Department commanders called it the largest security effort for an election ever seen in the city and equal to the ones for the annual New Year's Eve celebration in Times Square and for last year's visit by Pope Francis.

The deployment by the nation's largest police department will include heavily armed rapid-response teams on standby, bomb-sniffing dogs to combat terror threats and a larger uniformed and plainclothes police presence on the streets and in the subways. Other officers will be posted at each of the more than 1,200 polling places across the city.

Many officers will focus on crowd control in case of street disturbances once the results come in.

"Whatever happens, here in Times Square, we might see protests in the evening or celebrations, whichever it might be," the mayor said.

The NYPD also plans to tightly restrict traffic around Trump Tower on Fifth Avenue whenever the Republican nominee is there. Similar traffic restrictions will apply to the New York Hilton, the venue for Trump's election night gathering, and the Jacob K. Javits Convention Center, the scene of Clinton's festivities.

The beefed up security comes amid reports of unconfirmed threats that al-Qaida might be planning an attack in New York and elsewhere in the country on the eve of the election. Authorities have seen similar calls on social media for sympathizers of the Islamic State group to use violence to disrupt the U.S. election, which is not unusual for the group around the time of a big event, said John Miller, the NYPD's top counterterrorism official.

"We take all threats seriously, but we wouldn't be doing anything differently," Miller said. "The deployment is an all-out effort for public safety as well as counterterrorism."