Rep. Steve King, the embattled eight-term Republican congressman who has declared his support for ethnic nationalism and made a series of other racially incendiary comments, survived a challenge from a first-time Democratic candidate, J.D. Scholten, preserving the GOP’s control of Iowa’s 4th Congressional District.

The district, which lies in the northwest quadrant of the state, was long considered safe Republican territory. King barely campaigned, recycling an ad from an old campaign and refusing to debate his opponent.

But the nonpartisan Cook Political Report last week moved the race from “likely” to “lean” Republican, as King, 69, became engulfed in controversy in the aftermath of the massacre of 11 congregants at a Pittsburgh synagogue.

At a town hall last week, King erupted when an attendee asked him whether his hard-line views on race and identity bore resemblance to those of the Robert Bowers, the man accused of the deadliest anti-Semitic attack in the nation’s history.

Meanwhile, the Republican said Monday that he hoped Supreme Court Justices Elena Kagan and Sonia Sotomayor “will elope to Cuba,” hours before he was to appear with Iowa’s governor in an election-eve rally.

Some of his Republican colleagues have criticized King’s rhetoric, and the House Republican campaign arm said it wouldn’t “play” in his race as several major corporations cut off financial support.

But King’s once-fringe views have moved further into the mainstream under the Trump presidency, and he retained support from party bigwigs, such as Sen. Charles E. Grassley, also of Iowa.

King has long made controversial statements, comparing immigrants to dogs and saying young migrants had “calves the size of cantaloupes” because they were transporting heavy loads of marijuana. In 2015, he tweeted a cartoon depicting then-President Barack Obama wearing a turban.

His party didn’t rebuke him in June when he retweeted a message from a self-described “Nazi sympathizer.” Last month, he voiced support for Faith Goldy, an unsuccessful Toronto mayoral candidate who has promoted the false notion that a “white genocide” is underway. And last week, reports surfaced that King had met in August with members of an Austrian political party founded by former Nazis, during a trip funded by a group that promotes awareness of the Holocaust.

The congressman dismissed such criticism as “fake news.” The Des Moines Register reported Tuesday that it had been barred from King’s election night event.

King’s Democratic challenger walked a fine line between capitalizing on the modest backlash against King and alienating voters in the deep-red district, where voters in 2016 favored Trump to Hillary Clinton roughly 2-to-1.

Scholten, 38, is a former minor league pitcher and paralegal. He ran as an outsider and a populist. He landed the endorsement of Sen. Bernie Sanders (I-Vt.), as well as that of the Sioux City Journal, which has favored King in the past.

“The average person in Congress is 58 years old, with a net worth of $1 million,” Scholten said in an ad from earlier this year. “Well, I’m different. I’m 20 years younger and just shy of $1 million short of that average.”

He dared viewers, “Tell me this race is unwinnable.”