NEW YORK — Daniel Higgins is one cop who knows a thing or two about sting operations.

Although the New York Police Department detective’s main job is working in a counterterrorism unit, he is also one of two official department beekeepers who don protective gear and head to the scene when buzzing swarms of the insects glom onto buildings, streetlights or other pieces of the urban landscape.

The NYPD bee brigade responds to dozens of calls each spring and summer, including some recently where officers used vacuums to remove grotesque, wiggling masses of tens of thousands of bees from a lamppost near Grand Central Terminal, the awning of a restaurant and even a chained bicycle near Times Square.

Last month, the 911 alert that appeared on their handheld electronic device read: “Investigate possible crime: vicious animal.” That led to a swarm that had attached itself to a brick wall in Brooklyn.

“You try to get there as quickly as you can to corral them because you don’t want the bees to fall on the public. Even a wind gust can knock them down,” Higgins said.

About 20,000 bees were once plucked from a Park Avenue bush.

As unlikely as it may seem in a city considered a concrete jungle, New York has plenty of bees drawn to greenery that produces pollen, including flowers, plants, trees – even landscaped rooftops.

Since 2010, when the city legalized beekeeping, the New York honeybee population has soared from just a few dozen illegal hives. Most of the buzzing inhabitants live in about 300 government-registered hives in gardens, backyards and rooftops including an elegant Waldorf Astoria hotel terrace, according to the city’s Health Department. Hundreds more thrive in surrounding suburbs.

City officials welcome the bees – except when hives become overcrowded and about half the bees leave to form swarms that last a few days while an egg-laying queen and her “scouts” search for a new home. To startled city residents, the phenomenon can have a horror-film quality.

“They’ll come in with a loud buzz, like a school of fish, and then they cluster up,” Higgins said.

Wearing a protective suit, gloves and a meshed veil, Higgins and fellow NYPD beekeeper, Officer Darren Mays, suck up the huddled creatures with a vacuum linked to plastic buckets.

“We don’t kill the honeybees. We don’t spray them. We don’t destroy them. We relocate them,” Higgins said.

They’re donated to beekeepers so they can replenish their hives as bees die off, according to Higgins.