They did not exercise their right to remain silent.

Rock band The Strokes taunted a police officer with their anti-cop anthem “New York City Cops” as the law enforcer and event security confronted fans rushing the stage during their performance at a Bernie Sanders’ rally in New Hampshire.

Lead singer Julian Casablancas invited crowds at the University of New Hampshire’s Whittemore Center Arena to join the band on stage during their last song on Monday night.

“Come up on the stage, y’all. Come on, let them up!” Casablancas shouted, according to footage of the event.

But as ecstatic fans and supporters of the Vermont senator made their way up and began to jam on stage, New Hampshire a uniformed cop appears.

At one point, an officer seemingly tried to get Casablancas’ attention, as the singer belted out the chorus, which goes: “New York City cops, they ain’t too smart” and ignored him, chuckling.

University rep Erika Mantz confirmed to The Post in a statement: “Contract security asked police to help control crowd access to the stage and performers. There was no further incident.”

Several people on social media hailed the performance and ensuing push-back from the cops.

“The Strokes playing ‘NYC cops’ while actual cops kick them off stage, at a rally for maybe the only actually good candidate to run for president in my lifetime. We love to see it folks,” wrote @IanShaneRitter.

Added @rusteenh: “The Strokes playing ‘New York City Cops’ while uniformed police officers try to kick them off stage is an iconic #Bernie moment.”

More than 7,500 people flocked to the event, which included speeches from firebrand New York Congresswoman Alexandria Ocasio-Cortez and actress and failed New York gubernatorial candidate Cynthia Nixon.

Neither the Strokes’ label Cult Records, nor the Sanders campaign immediately responded to requests for comment.

The Manhattan-based band’s pulled the song from their debut 2001 album “Is This It,” due to the September 11 attacks, and it was released at a later date.