It’s every rebellious rocker’s dream optic: getting to sing a song complaining about police literally in the face of police taking the stage. That was the scenario as New Hampshire officers took to the Strokes’ stage when fans swarmed the band as they wrapped up an appearance at a Bernie Sanders rally by performing “New York City Cops.”

The lawmen stepped up at the conclusion of what was billed as a “concert rally,” in which the Strokes were preceded by pro-Sanders speeches from Rep. Alexandria Ocasio-Cortez, Cynthia Nixon and Dr. Cornel West.

According to some accounts, “New York City Cops” was not on the group’s setlist, but the Stokes performed the song from their debut album — which includes the refrain “New York City cops, but they ain’t too smart” — after taking umbrage at lights being turned up and attempts to stop crowd-surfing among fans.

The backdrop for the rally, like T-shirts being sold, turned Sanders’ name into a logo resembling the band’s own. The rally took place at the Whittemore Center Arena at the University of New Hampshire, in Durham, N.H.

The morning after the campaign stop, the Strokes announced their first album in seven years, “The New Abnormal,” produced by Rick Rubin. A video was released Tuesday for the new song “At the Door,” which the band premiered in its New Hampshire set.

The group has European shows booked in February and returns to North America the following months with shows in Vancouver, Seattle and Los Angeles (March 14 at the Forum).

Fans can count on NYC themes on the new album, as well, judging from promised song titles like “Brooklyn Bridge to Chaos” and the closing song, “Ode to the Mets.”

“New York City Cops” has a history of controversy. Back in 2001, when the Strokes’ debut was set for release, the tune was replaced with “When It Starts” on U.S. versions of the album, prompted by a fear of disrespecting NYC law reinforcement immediately following the terrorist attacks in the city.