Jason Spencer, the Georgia Republican lawmaker who was fooled into repeatedly yelling a racial epithet on the comedian Sacha Baron Cohen’s television series, intends to resign effective July 31. The decision was announced early Wednesday in an email from the office of David Ralston, the Georgia House speaker.

It was the first real-world consequence of Mr. Cohen’s Showtime series, “Who Is America?” The show has pranked a long list of sitting and former lawmakers, including the former Vice President Dick Cheney; Rep. Dana Rohrabacher, Republican of California; and the former vice-presidential candidate Sarah Palin.

The episode featuring Mr. Spencer aired on Sunday, and he initially resisted calls to resign, even from within his own party. Gov. Nathan Deal, a Republican, said in a post on Twitter on Monday that “the actions and language used by Jason Spencer are appalling and offensive.” Mr. Spencer lost his primary in the spring in his bid for a fifth term and initially said he would serve out his final five months, but the drum beat became too loud.

[Sacha Baron Cohen is duping Republicans. Is he the James O’Keefe of the left?]

By the time the speaker’s office announced the resignation, a fierce bipartisan effort to cast Mr. Spencer out of office had taken shape. It was clear that he would face sustained public and private pressure, and black lawmakers had planned a state Capitol news conference for Wednesday morning to demand that Mr. Spencer step aside.