Representative Steve King of Iowa, the nine-term Republican with a history of racist comments who only recently became a party pariah, lost his bid for renomination early Wednesday, one of the biggest defeats of the 2020 primary season in any state.
In a five-way primary, Mr. King was defeated by Randy Feenstra, a state senator, who had the backing of mainstream state and national Republicans who found Mr. King an embarrassment and, crucially, a threat to a safe Republican seat if he were on the ballot in November.
The defeat was most likely the final political blow to one of the nation’s most divisive elected officials, whose insults of undocumented immigrants foretold the messaging of President Trump, and whose flirtations with extremism led him far from rural Iowa, to meetings with anti-Muslim crusaders in Europe and an endorsement of a Toronto mayoral candidate with neo-Nazi ties.
In interviews over the years, voters in Iowa’s most conservative region downplayed Mr. King’s incendiary comments. His loss after 18 years in office was mainly because opponents painted him as ineffective after party leaders in Congress stripped him of his committee assignments last year.
That move came after comments that Mr. King made in an interview with The New York Times in 2019, in which he asked, “White nationalist, white supremacist, Western civilization — how did that language become offensive?”
The remarks caused an uproar. Senator Mitch McConnell, the Republican majority leader, told Mr. King “to find another line of work.”
Instead, Mr. King clung to his seat, claiming to be the victim of Republican insiders and of the news media.
Now Mr. Feenstra, a political and social conservative in a deep-red district, is the odds-on favorite to hold the seat against J.D. Scholten, who nearly defeated Mr. King two years ago and ran unopposed in the Democratic primary.
The belief that Mr. King, first elected in 2002, was vulnerable this year drew four challengers, including Mr. Feenstra; Jeremy Taylor, a former state lawmaker; and two businessmen, Bret Richards and Steve Reeder. All four opponents campaigned as equally conservative as Mr. King on red-meat issues like abortion and gun rights, but they promised more effective representation of the district after Mr. King lost his committee assignments.
“Our Fourth District desperately needs a seat at the table,” Mr. Feenstra said at a debate last month, calling for the district to have “an effective conservative voice.”
Mr. Feenstra, the preferred candidate of establishment Republicans seeking to oust Mr. King, easily outraised the incumbent, bringing in $925,800 to Mr. King’s $331,000. He won endorsements from the U.S. Chamber of Commerce and the National Right to Life Committee. And in an extraordinary rebuke of Mr. King by House colleagues, five Republican congressmen donated to Mr. Feenstra’s campaign.
Rather than attack Mr. King’s years of demeaning comments about immigrants — he once compared Dreamers to drug mules “with calves the size of cantaloupes” — Mr. Feenstra portrayed the congressman as powerless to help Iowans.
Mr. King, 71, claimed during the campaign that Representative Kevin McCarthy of California, the House Republican leader, had privately pledged to help him regain his committee assignments. But Mr. McCarthy denied having said any such thing, adding that if the Republican Steering Committee, which decides on committee roles, met again to weigh in on Mr. King, he would not win back his posts.
Even before facing Republican discipline in the House in January 2019 after the Times interview, Mr. King was in electoral trouble. He just barely won re-election in 2018 over Mr. Scholten, a former professional baseball player, by three percentage points — in a district Mr. Trump carried by nearly 30 points.
Just before the election, the head of the Republican House campaign arm, Representative Steve Stivers of Ohio, issued a highly unusual rebuke of Mr. King for his endorsement of the Toronto mayoral candidate, Faith Goldy, who has espoused white nationalism, and for comments seeming to embrace the “Great Replacement,” a far-right conspiracy theory. “We must stand up against white supremacy and hate in all forms, and I strongly condemn this behavior,” Mr. Stivers said at the time.
A paradox of Mr. King’s career is that, in his anti-immigrant language and policies, he was years ahead of Mr. Trump, who won the presidency by stirring fears about nonwhite immigrants.
Well before Mr. Trump promised to build a wall on the southwest border, Mr. King, who founded an earth-moving company, stood on the House floor and showed off a model of a 12-foot border wall of his own design.
Soon after Mr. Trump took office, he invited Mr. King — who even then was snubbed by establishment Republicans like the former House speaker John A. Boehner — to the Oval Office. The president boasted to Mr. King of having supported him, and raised money for him during an Iowa visit in 2014, Mr. King told The Times.
In the past, Mr. King routinely won the backing of other Iowa Republicans, including Gov. Kim Reynolds, who named him a co-chair of her 2018 election campaign. He sought to be a kingmaker in presidential politics given Iowa’s early-voting role, and in 2015 he endorsed Senator Ted Cruz of Texas, who went on to win the state’s caucuses over Mr. Trump.
“For two decades Steve King has been something of the sun in the political universe around here,” Douglas Burns, an owner of newspapers in Mr. King’s district, said on Tuesday night. “I’ll still have to see the eclipse tomorrow to believe these results.”