Heavily armed NYPD officers were ordered into neighborhoods with large gay populations and outside LGBT clubs and landmarks across the city Sunday in the wake of the Florida bloodbath.

“We are vigilant. We have deployed our critical response command and our strategic response groups, so you’ll see a lot of additional police presence on the streets of the city,’’ Mayor de Blasio said.

James Waters, the NYPD’s head of counterterrorism operations, said security around gay landmarks and institutions will be visible for several days.

“We’ve selected locations in the downtown area like the Stonewall and the vicinity,” he said, referring to the historic gay-rights site in Greenwich Village.

“We will be moving from place to place and moving our resources around.”

The Orlando, Fla., killer, Omar Mateen of Port St. Lucie, Fla., targeted a gay nightclub.

He was born in New York and posted pictures of himself on ­MySpace in an NYPD T-shirt and golf shirt but has no known substantial ties to New York City or the NYPD, authorities said.

“At this time, he has no connections to anything NYPD,” Chief of Department James O’Neill said.

There was a noticeable police presence around the historic Stonewall Inn on Sunday, where people stunned by the Florida horror paid their respects.

Anthony Codalopez, 35, a poet from the Upper East Side, laid 50 roses in front of the building, one for each person killed.

“I wanted people to walk past them and think of each person,’’ he said.