Chris Rock surprised audiences at the New York Comedy Festival on Friday, taking the stage before Hannibal Buress at the Apollo and telling the audience they’ll be seeing more of him on TV due to his divorce.

“When you see me on ‘Dancing With the Stars’ . . . I’m not on crack, that’s just alimony!” Rock finalized his divorce from his wife of nearly 20 years, Malaak Compton-Rock, this summer.

He also urged the crowd to vote, with a spy telling us he said that Donald Trump’s very existence is proof that black people “aren’t overreacting” to recent issues.

More comics performed over the weekend as part of the festival, with much of it turning to politics.

Marc Maron wondered if Hillary Clinton is a criminal or “just an older lady who didn’t understand her phone.” Bill Maher joked of the CNN-hosted debate, “Poor Anderson Cooper had to ask [Trump] three times, ‘Did you do what you said?’ He’s not had to think about p - - - y this much his whole life.”

Also performing were Fred Armisen and Tracy Morgan, who brought his ­3-year-old daughter, Maven, onstage after his set.