Georgia state Rep. Jason Spencer resigns after baring his butt and yelling the n-word on TV.

Georgia state Rep. Jason Spencer (R) charges at Sacha Baron Cohen, who was posing as an Israeli security expert, during a segment on Showtime’s Who Is America? aired on July 22.

A Georgia politician is resigning after baring his butt and yelling the n-word on national television.

Republican state Rep. Jason Spencer appeared on satirist Sacha Baron Cohen’s Showtime series, Who Is America? Based on the video and Spencer’s statements after the appearance, Spencer went on the show — in which Cohen dons makeup to go undercover — under the premise that he was going to learn how to defend himself from a potential terrorist attack after he authored a bill attempting to ban burqas.

In the segment, Cohen, posing as an Israeli security expert named Erran Morad, made ridiculous suggestions to Spencer. Spencer followed the suggestions and then some:

Spencer brandished stereotypes of a Chinese tourist while using a selfie stick to slide a phone camera beneath an actor’s burqa to take a picture. The exercise was supposed to teach Spencer how to identify terrorists, because the pictures can reveal if a weapon is under a burqa.

Cohen’s character, Morad, told Spencer that one way to attract attention in public and thwart a potential kidnapper is to yell an unspecified “n-word.” Spencer, in response, repeatedly shouted the racist slur. Morad then said, “You crazy? The n-word is ‘noonie.’ Not this word. This word is disgusting.”

Morad then told Spencer that dropping his pants and touching terrorist attackers with his bare butt would scare them away, because the attackers would be frightened by the possibility that the contact would turn them gay. Spencer followed along, pulling down his pants and chasing Morad with his bare butt while chanting, “USA!” and “America!”

In a post-credits video, Spencer, in “A Message to Terrorists,” said, “All you damn sand-ni**ers over in the Middle East, we are tired of you coming to America, and we are tired of you trying to threaten us.”

You can watch the whole thing in full:

Spencer initially resisted calls for his resignation, arguing that Cohen’s team had taken advantage of his genuine fears of a terrorist attack. Facing criticism from members of his own party, including Gov. Nathan Deal, Spencer backed down on Tuesday night, sending a letter of resignation to Georgia state House Speaker David Ralston, effective July 31.

Cohen’s show and its tactics, however, are not without their critics. As Todd VanDerWerff previously wrote for Vox:

I don’t know what Who Is America? wants to do beyond cynically call attention to itself. I laughed at it a handful of times, because Baron Cohen is a talented performer and a funny guy. But the blood it draws is very thin indeed. Who Is America? concludes that reality stars are vapid, that you can get most people to do stupid shit if you turn a camera on them, and that politicians are insincere phonies who will read whatever you throw on a teleprompter in front of them.

In this case, though, there was a valuable service: Spencer’s bad judgment and racism were exposed. That he’s capable of such behavior is something his constituents would surely like to know.

Still, it’s of limited political value in the long term, because Spencer had already lost his primary bid and was not running for reelection. But the resignation means he will not be able to finish out his term after a display of buffoonery and racism.