NEW YORK-- Democratic presidential candidate Hillary Clinton and her ally New York City Mayor Bill de Blasio are taking heat for a race-based joke they made at a charity event over the weekend.

Appearing on stage at the Inner Circle Show, an annual New York comedic performance held for charity, Clinton set up the joke: "I just have to say thanks for the endorsement, Bill. Took you long enough," she said, referring to the fact that he endorsed her months after she launched her campaign.

Get Breaking News Delivered to Your Inbox

"Sorry Hillary, I was running on C.P. time," de Blasio responded, seemingly referring to the slang term "colored people time." The term alludes to the stereotype that African Americans are typically late.

Actor Leslie Odom Jr., who plays Aaron Burr in the musical "Hamilton," was also on stage and told the mayor, "That's not -- I don't like jokes like that, Bill." Clinton then delivered the punchline, responding that de Blasio was referring to "cautious politician time."

The African-American website TheRoot.com called the joke "cringeworthy," as did the liberal site Salon.com. The left-leaning site RawStory.com similarly called it "painful," while the conservative website TownHall.com called it "absolutely painful" and lamented, "It's only racist if Republicans do it."

De Blasio addressed the complaints on Monday on CNN, insisting that "people are missing the point of it."

"It was clearly a staged show. It was a scripted show and the whole idea was to do the counter intuitive and say 'cautious politician time,'" he said. "Every actor involved, including Hillary Clinton and Leslie Odom Jr., thought it was a joke on a different convention. That was the whole idea of it."

A spokesperson for the mayor added in a statement to CBS News, "Let's be clear, in an evening of satire, the only person this was meant to mock was the Mayor himself, period. Certainly no one intended to offend anyone."