Infiltrators slipped past the NYPD’s anti-terror nexus before the dawn’s early light Tuesday, climbed to the tops of both Brooklyn Bridge towers — and swapped the American flags there for white banners in one of the most stunning security breaches in the city’s history.

“We’re lucky they just put flags up there — and not a bomb,” a law-enforcement source said. “It’s an embarrassment . . . It could have been terrible. Who knows how much how much damage it could have done.”

The four or five intruders, possibly working in two teams, went completely unnoticed by cops in the four patrol cars assigned to the bridge and nimbly climbed hundreds of feet on narrow main suspension cables, police sources said.

They then got past locked gates and climbed ladders to get to the top of each of the 276-foot towers.

To stay undetected, they zip-tied aluminum lasagna pans over the floodlights aimed at the flags — blacking out the Brooklyn side at 3:29 a.m. and the Manhattan tower 13 minutes later, cops said.

“This may be somebody’s art project, or it may be somebody’s attempt at making a statement . . . We haven’t seen a credible claim of responsibility,” said NYPD Deputy Commissioner of Intelligence John Miller.

“For someone to compromise that gate by going around it and continue to the top of the tower, have the right size cover to put over the light, there’s some indication of some good deal of pre-operational planning, perhaps some indication that they have experience climbing in construction or in bridgework, or that they may have actually been up there before looking at the ­dimensions.”

A police officer finally spotted the 11-by-20-foot white flags — commonly a symbol for surrender — at around 5:30 a.m., as the sun came up, sources said.

Emergency Service cops clambered up the towers, pulled the banners down and folded them into tight triangles using traditional procedures at about 11 a.m.

Police are trying to figure out how the bridge, long a potential terror target, became so vulnerable.

Around-the-clock patrol cars are stationed on both sides of the bridge, and security cameras are focused on the towers.

Cops also park nearby on Tillary and Old Fulton streets in Brooklyn and periodically drive the span of the bridge to look for signs of trouble.

The squad cars on the span face the center — but there is not a clear view of the top of the towers, sources said.

“It amazes me nobody saw anything . . . I’m upset,” said cigar-chomping Department of Transportation bridge worker Nick Krevatas 49, who was called in to hoist replacement American flags.

“Our big boss called. He told us someone put white flags up and we had to replace them immediately. I said. ‘OK, no problem. We’re on our way.’

“Isn’t there a better way to express yourself? Couldn’t they have used social media?”

The NYPD’s Miller tried to make light of the breach, saying of the whited-out flags that he’s “not sure if this is Betsy Ross’ long-lost nephew doing extensive work.”

Additional reporting by Amber Sutherland, Aaron Feis, Natasha Velez, Ross Toback and Natalie O’Neill

https://twitter.com/MarkWeprin/status/491576968337317888/