A Georgia state lawmaker who yells the N-word and exposes his rear end in the latest episode of Sacha Baron Cohen's new satirical TV show, "Who is America?" is resigning. Jason Spencer's decision was confirmed by CBS News early Wednesday. CNN was first to report it.

Kaleb McMichen, a spokesperson for Georgia House Speaker David Ralston, told CBS News Spencer emailed Ralston late Tuesday night saying, "I will be resigning my post effective July 31, 2018."

Spencer was already a controversial figure. He had previously tried to get burkas banned in public. He also threatened a black attorney opposed to Confederate monuments. After this latest incident, Spencer insists he was tricked.

Get Breaking News Delivered to Your Inbox

Spencer says he thought an ex-Israeli military officer was teaching him self-defense while speaking to Cohen in disguise. Following prompts from Cohen, Spencer made several anti-ethnic and anti-gay remarks, pretended to take lewd photographs underneath a burka, exposed his backside and yelled the N-word.

Spencer had been balking at quitting, though he apologized in a statement Monday for the "ridiculously ugly episode."

He also said, "Sacha Baron Cohen and his associates took advantage of my paralyzing fear that my family would be attacked. … I deeply regret the language I used at his request."

Spencer may have felt embarrassed, but Georgia's Republican leaders said they were appalled.

Gov. Nathan Deal said he was "saddened and disgusted." Ralston and both Republicans running to become the next governor demanded Spencer step down.

One of them, Georgia Secretary of State Brian Kemp, beat once heavily favored Lt. Gov. Casey Cagle in a runoff Tuesday for the Republican nomination to face Democrat Stacey Abrams in November.

Spencer lost the Republican primary in May. If he hadn't resigned, he would have served out the remaining five months of his term.

The Spencer appearance came in the second episode of Cohen's controversial series. In it, the British comedian known for his alter-egos uses a stable of new characters to dupe anyone from average Americans to public officials, like former Vice President Dick Cheney.

Cohen asked Cheney what his favorite war was, to which Cheney replied Desert Storm.

The show airs on Showtime, a division of CBS.