Now playing
01:50
State Rep. resigns after screaming N-word
PHOTO: Garret Ventry
Now playing
01:33
GOP adviser abruptly quits amid sex harassment claim
PHOTO: Getty Images
Now playing
01:49
Trump defends Kavanaugh amid allegations
WASHINGTON, DC - APRIL 21:  Rep. Chris Collins (R-NY) talks to reporters following a meeting with fellow members of Congress and representatives from the Donald Trump presidential campaign at the National Republican Club of Capitol Hill April 21, 2016 in Washington, DC. (Chip Somodevilla/Getty Images)
WASHINGTON, DC - APRIL 21: Rep. Chris Collins (R-NY) talks to reporters following a meeting with fellow members of Congress and representatives from the Donald Trump presidential campaign at the National Republican Club of Capitol Hill April 21, 2016 in Washington, DC. (Chip Somodevilla/Getty Images)
PHOTO: Chip Somodevilla/Getty Images
Now playing
02:34
GOP lawmaker indicted for insider trading
SAN DIEGO, CA - AUGUST 23: Rep. Duncan Hunter (R-CA) walks into the Federal Courthouse for an arraignment hearing on August 23, 2018 in San Diego, California. Hunter and his wife Margaret are accused of using more than $250,000 in campaign funds for personal use. (Photo by Sandy Huffaker/Getty Images)
SAN DIEGO, CA - AUGUST 23: Rep. Duncan Hunter (R-CA) walks into the Federal Courthouse for an arraignment hearing on August 23, 2018 in San Diego, California. Hunter and his wife Margaret are accused of using more than $250,000 in campaign funds for personal use. (Photo by Sandy Huffaker/Getty Images)
PHOTO: Sandy Huffaker/Getty Images North America/Getty Images
Now playing
03:19
GOP lawmaker blames wife in corruption case
Now playing
01:50
State Rep. resigns after screaming N-word
PHOTO: Rep. Jason Lewis
Now playing
02:53
GOP rep. defends prior comments on 'slut' women
In this Jan. 29, 2018, file photo, Missouri Gov. Eric Greitens speaks in Palmyra, Mo.
In this Jan. 29, 2018, file photo, Missouri Gov. Eric Greitens speaks in Palmyra, Mo.
PHOTO: Jeff Roberson/AP
Now playing
02:29
Missouri Gov. Eric Greitens indicted
 Eric Greitens Founder and CEO, The Mission Continues speaks at the Robin Hood Veterans Summit at Intrepid Sea-Air-Space Museum on May 7, 2012 in New York City.
Eric Greitens Founder and CEO, The Mission Continues speaks at the Robin Hood Veterans Summit at Intrepid Sea-Air-Space Museum on May 7, 2012 in New York City.
PHOTO: Getty Images
Now playing
00:44
Governor admits affair, denies blackmail
Now playing
02:22
Sex scandals in Washington through the years
Megan Barry
Megan Barry
PHOTO: WZTV
Now playing
01:11
Mayor admits affair with head of her security
 The White House is shown during departure by President Donald Trump for the congressional Gold Medal ceremony for former Senate Majority Leader Bob Dole at the U.S. Capitol January 17, 2018 in Washington D.C. (Al Drago-Pool/Getty Images)
The White House is shown during departure by President Donald Trump for the congressional Gold Medal ceremony for former Senate Majority Leader Bob Dole at the U.S. Capitol January 17, 2018 in Washington D.C. (Al Drago-Pool/Getty Images)
PHOTO: Pool/Getty Images
Now playing
00:51
Second WH aide resigns after abuse accusations
UNITED STATES - DECEMBER 13: Rep. Blake Farenthold, R-Texas, attends a House Judiciary Committee hearing in Rayburn Building on the Justice Department
UNITED STATES - DECEMBER 13: Rep. Blake Farenthold, R-Texas, attends a House Judiciary Committee hearing in Rayburn Building on the Justice Department's investigation of Russia's interference in the 2016 election featuring testimony by Deputy Attorney General Rod Rosenstein on December 13, 2017. (Photo By Tom Williams/CQ Roll Call) (CQ Roll Call via AP Images)
PHOTO: Tom Williams/AP
Now playing
01:30
Ex-Farenthold aide felt pressured, source says
Now playing
01:02
Congressman calls female colleagues 'eye candy'
Former Congressman Anthony Weiner (D-N.Y.), center, leaves federal court following his sentencing, Monday, Sept. 25, 2017, in New York. Weiner was sentenced to 21 months in a sexting case that rocked the presidential race.
Former Congressman Anthony Weiner (D-N.Y.), center, leaves federal court following his sentencing, Monday, Sept. 25, 2017, in New York. Weiner was sentenced to 21 months in a sexting case that rocked the presidential race.
PHOTO: Mark Lennihan/AP
Now playing
01:04
A timeline of Anthony Weiner's sexting scandals
PHOTO: Pool
Now playing
00:56
Boy demands apology from Mike Pence
(CNN) —  

Jason Spencer, a Georgia state lawmaker who dropped his trousers and repeatedly used the “n-word” on an episode of the Showtime series “Who Is America?” on Sunday night, has announced his resignation.

His resignation will take effect on July 31, according to a letter he submitted to Georgia House Speaker David Ralston.

Spencer, a Republican who represents the community of Woodbine in southeast Georgia, appeared in a segment in which the show’s star, Sacha Baron Cohen, played a character named Col. Erran Morad.

Spencer was pranked into believing the comedian was an Israeli anti-terrorism expert who was able to convince the legislator that a series of racist acts would protect him against terrorists.

They first discussed Spencer’s support of a burqa ban.

Spencer told Cohen’s character, “I don’t call it a burqa ban, I call it an anti-masking statute.”

Sacha Baron Cohen punks politicians in Showtime series ‘Who is America?’

From there, Cohen engaged in a series of supposed anti-terrorism exercises that included telling Spencer to yell as a way of attracting attention during an ISIS kidnapping attempt.

“In America there is one forbidden word,” Cohen said. “It is the ‘n-word.’”

After Spencer yelled the racial slur, Cohen responded “Are you crazy? The ‘n-word’ is noonie! Not this word. This word is disgusting.”

“Got it,” Spencer said.

Cohen also got Spencer to imitate an Asian accent in an exercise that had him pretending to be an Asian tourist in an attempt to take a photo under a person’s burqa and to drop his trousers “to use your buttocks to intimidate ISIS.”

Ralston called Spencer’s actions and language “reprehensible” in a statement provided to CNN, and called for him to resign, saying: “Georgia is better than this.”

Georgia Gov. Nathan Deal tweeted about Spencer’s actions on Monday.

“The actions and language used by Jason Spencer are appalling and offensive,” Deal tweeted. “There is no excuse for this type of behavior, ever, and I am saddened and disgusted by it.”

Spencer has not returned calls from CNN, but told the Atlanta Journal-Constitution the Showtime series got him to participate by taking advantage of his fears that he or his family would be attacked – fears sparked by death threats he says he received after he proposed legislation barring Muslim women from wearing burqas in public.

“In posing as an Israeli agent, (Cohen) pretended to offer self-defense exercises. As uncomfortable as I was to participate, I agreed to, understanding that these ‘techniques’ were meant to help me and others fend off what I believed was an inevitable attack.

“My fears were so heightened at that time, I was not thinking clearly nor could I appreciate what I was agreeing to when I participated in his ‘class.’ I was told I would be filmed as a ‘demonstration video’ to teach others the same skills in Israel. Sacha and his crew further lied to me, stating that I would be able to review and have final approval over any footage used.

“I deeply regret the language I used at (Cohen’s) request as well as my participation in the ‘class’ in general. If I had not been so distracted by my fears, I never would have agreed to participate in the first place.

“I apologize to my family, friends, and the people of my district for this ridiculously ugly episode,” Spencer said.

Spencer told the Atlanta Journal-Constitution the show “exploited” his state of mind “for profit and notoriety.”

“This media company’s deceptive and fraudulent behavior is exactly why President Donald Trump was elected,” he said in a statement last week in response to other politicians falling prey to the comedian.

Showtime had no comment when contacted by CNN on Monday.

Still in character, Cohen, as Israeli Col. Erran Morad, posted videos of Spencer on Twitter with this message:

“Boker tov. I have been inform elected official & all-round mensch I meet, Jason Spencer, have somehow been portray in bad light by Showtime. To reveal the truth, here is the unedited film. Do not worry Jason Shpenker, Erran Morad have got your backside.”

Previous calls for Spencer’s resignation

Some called for Spencer’s resignation last year after he warned former state Rep. LaDawn Jones, a black woman, that she would not be “met with torches but something a lot more definitive” if she continued to call for the removal of Confederate statues in south Georgia, and suggested that someone who didn’t understand this “will go missing in the Okefenokee” swamp.

Spencer was elected to the Georgia House in 2010. He has served four terms and is still in office, but was defeated by political newcomer Steven Sainz in the Republican primary in May.

CNN’s Joe Sutton contributed to this report.