A political event hosted by “Broad City” star Ilana Glazer at a historic Brooklyn synagogue was canceled Thursday when a vandal scrawled “Kill all Jews” inside.

The NYPD said “anti-Semitic messages” were discovered on the stairwell of Union Temple in Prospect Heights around 8 p.m. Thursday.

At about 8:30, Glazer came out of the venue to tell the crowds that the 8 p.m. event, in which she was scheduled to interview journalist Amy Goodman and New York state Senate candidates Andrew Gounardes and Jim Gaughran, was canceled because of the graffiti.

“She didn’t feel comfortable ushering 200 people into the enclosed space; potential sitting ducks,” an attendee named Kathryn Gonzalez posted on Facebook.

A custodian told The Post that hateful slurs were found on the second and fifth floor and that the anti-Semitic vandal had scrawled “Kill all Jews” on a door.

“There was a lot of anxiety,” Gonzalez told The Post. “Especially given last weekend’s events and the upcoming election, the tension and fear feels heightened.”

The event was part of Glazer’s The Generator Series, in which she interviews activists and politicians “to see how they serve us — the people,” according to the description.

“I hope it doesn’t have a chilling effect on people going to vote,” Gounardes told The Post. “We can’t afford to stand in the silence or be scared or intimated.”

“This is not the New York City that any of us want to be living in.”

The anti-Semitic graffiti comes just a day after vandals drew a swastika and scrawled a racial epithet on a Brooklyn Heights brownstone and less than a week after a mass murder at a Pittsburgh synagogue, where the gunman allegedly yelled “All Jews must die!”

Police were investigating the Brooklyn crime and had no arrests as of Thursday night.