Georgia state lawmaker Jason Spencer resigned Tuesday night after he was lured into exposing both his racism and his buttocks on Sacha Baron Cohen's new Showtime series, "Who Is America."

In a terse letter to Georgia State House Speaker David Ralston, who called on him to resign following Sunday's airing of the second episode of Cohen's show, the representative stated, "This email/letter is to serve as an official resignation notice to your office that I will be resigning my post effective July 31, 2018."

Ralston said the legislator "disgraced himself and should resign immediately," The Atlanta Journal-Constitution reported. GOP Gov. Nathan Deal said in a tweet: "There is no excuse for this type of behavior, ever, and I am saddened and disgusted by it."

Spencer appeared in a segment in which Cohen portrays an Israeli military expert who is making a video about how to mount a personal defense against potential terrorists. In one scene Cohen's character urges Spencer to draw attention to an unfolding attack.

The lawmaker responds by shouting the n-word.

In another, Cohen says that Muslim extremists are religiously repulsed by human buttocks. He persuades Spencer to fend off an attacker by charging at him backwards ― he shouts "USA!" and "America!" ― with his bare bottom exposed.

Rep. Jason Spencer speaks at the Georgia State Capitol in Atlanta on Feb. 28, 2018. Alyssa Pointer / AP file

Spencer also speaks with a mock Asian accent while pretending to take so-called up-skirt photos from under a Muslim woman's burqa.

Spencer apologized, but for Georgia's top Republicans it was the last straw. In 2016 he was accused by civil rights and Muslim advocacy groups of trying to ban religious headgear.

Cohen, meanwhile, has racked up a string of gotcha videos with politicians for "Who Is America." His subjects so far include former Vice President Dick Cheney, Democratic Sen. Bernie Sanders, and former GOP vice presidential candidate Sarah Palin.

The show has railed against gun violence and religious intolerance by attempting to portray some leaders, mostly Republicans, as clueless.