A Georgia state lawmaker on Tuesday announced that he will resign just days after he appeared on an episode of Sacha Baron Cohen’s controversial new show, “Who is America?” in which he took off his pants and shouted racial slurs.

Rep. Jason Spencer plans to step down from his post on July 31, the Georgia House speaker's office said.

Spencer faced backlash after he repeatedly yelled the N-Word and mimicked a Chinese tourist while taking a photo up the skirt of an actor pretending to be a Muslim woman during Sunday’s episode.

Cohen, who posed as an Israeli military expert, also had Spencer expose his backside in an exercise to ward off a potential terrorist, while shouting, “USA mother----r.”

Spencer is one of several public figures -- including Sen. Bernie Sanders, I-Vt., and former vice presidential candidate Sarah Palin -- who claimed to have been duped into participating in the Showtime program.

Spencer previously said he was tricked into doing the show because of his “fears that I would be attacked by someone” and that “they exploited my state of mind for profit and notoriety.”

“This media company’s deceptive and fraudulent behavior is exactly why President Donald Trump was elected,” Spencer said in a statement to the Atlanta Journal-Constitution, while threatening to take legal action if the “fraudulently obtained footage of me is used by these Hollywood liberals to line their own pockets.”

Several Republican colleagues called for Spencer’s resignation following his “appalling and offensive” conduct on the show.

“There is no excuse for this type of behavior, ever, and I am saddened and disgusted by it,” Georgia Gov. Nathan Deal, a Republican, said in a tweet.

Georgia Secretary of State Brian Kemp, who is running for governor, removed Spencer from his campaign’s list of endorsements, he announced on social media.

“Rep. Spencer's words and behavior are hurtful, insensitive, and completely unacceptable. At the very least, he should issue a public apology for this shameful incident,” Kemp said in a statement.