A comic gag turned into a gaffe for Democratic presidential hopeful Hillary Clinton and New York Mayor Bill de Blasio, triggering a storm of social media comment accusing them of being insensitive to African-Americans.

Clinton on Saturday took the stage with de Blasio at the Inner Circle, an annual media roast of city and state politicians that traditionally ends with New York's mayor delivering a snarky rebuttal in the form of a rehearsed skit, often with the help of Broadway cast members.

This year Leslie Odom Jr., who is black and plays Aaron Burr in the hit Broadway show "Hamilton," participated in the skit in which Clinton teased de Blasio about his delay in endorsing her bid for the White House.

"Sorry, Hillary, I was running on C.P. Time," de Blasio said, referring to the phrase "colored people's time," an in-joke used to indicate chronic lateness but also viewed as a negative stereotype.

"I don't like jokes like that," Odom said, apparently as part of the skit.

Clinton then delivered the punchline: "'Cautious politician time,'" she said. "I've been there."

RELATED: Bill Clinton confronts protesters who say his crime reforms hurt blacks

The joke set off angry reaction on social media with commentators criticizing Clinton, who has strong support from black voters, and de Blasio, whose wife Chirlane McCray is African-American, for insensitivity.

Despite opinion polls showing Clinton has overwhelming support among African Americans heading into New York state's Democratic primary next Tuesday, some supporters worry her challenger Bernie Sanders has begun making inroads.

De Blasio, who was Clinton's campaign manager in her successful election to the U.S. Senate in 2000, defended the joke in an appearance on CNN on Monday. "It was clearly a staged show," he said. "I think people are missing the point here."

In a statement on Monday, the mayor's office said, "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."

In an interview with Cosmopolitan magazine, Clinton distanced herself from the skit.

"Well, look, it was Mayor de Blasio's skit," she was quoted as saying. "He has addressed it, and I will really defer to him because it is something that he's already talked about."