Baron Cohen pranked the Republican - who represents the community of Woodbine in south east Georgia - into believing he was an Israeli anti-terrorism expert named Colonel Erran Morad.
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 pants "to use your buttocks to intimidate ISIS".
Israeli missiles shoot down Syrian fighter jet
We will not accept any such penetration of, or spillover into, our territory, neither on the ground nor in the air. Syrian news agency Sana said Israel had targeted the jet over Syrian airspace, but did not say whether it was hit.
Spencer also partially pulls down his trousers and chases Cohen with his buttocks exposed, yelling, "USA, motherf--!"
In a statement on Monday, Spencer apologised for the "ridiculously ugly episode" but he initially refused to step down. He was due to lose his position later this year after being defeated by political newcomer Steven Sainz in the GOP primary elections in May.
In a statement, Spencer said he had received countless death threats after he introduced legislation in 2016 in an attempt to ban burqas. Now he'll step down at month's end, according to the letter he sent to Speaker David Ralston.
Rep. Jason Spencer of Georgia was duped by Cohen on the second episode of Who Is America? .
Florida sheriff won't charge man in deadly "stand your ground" shooting
Rich Kelly says the man picked a fight with him over a parking spot, using racial slurs, and even threatening to kill him. Investigators say he was cooperative and spoke openly with investigators about what had transpired.
Who Is America? airs Sundays at 10 p.m. ET on Showtime.
Georgia Gov. Nathan Deal called Spencer's actions and language "appalling and offensive". Cohen tells Spencer that nothing scares a terrorist more than being a "homo". "There is no excuse for this type of behavior, ever, and I am saddened and disgusted by it".
British comedian Sacha Baron Cohen's new TV show "Who Is America?" pranked U.S. politicians and congressmen. But his resignation doesn't come without some cost: Had Spencer stayed through the end of his term, he would have been eligible for taxpayer-funded health insurace for the rest of his life.
Meghan Markle Is Called Out By Half-Sister For Allegedly ‘Ignoring’ Her Father
Prince Harry and Meghan Markle visiting the Nelson Mandela Centenary Exhibition at Southbank Centre's Queen Elizabeth Hall . The 53-year-old's Twitter outburst comes following shock claims that Thomas Markle actually faked his heart attack in May.