Despite being condemned by members of his own party over coziness with white nationalist groups, eight-term incumbent Rep. Steve King narrowly held onto his seat in Iowa’s ultra-conservative 4th Congressional District on Tuesday.

King, a conservative who has become well-known for racist remarks and controversial associations, defeated Democratic newcomer and former professional baseball player J.D. Scholten by just 10,500 votes on Tuesday. Scholten did not immediately return a VICE News request for comment Wednesday, but wrote on Twitter that “you haven’t seen the last of J.D. Scholten.”

While King’s supporters are relieved, his detractors are shocked they couldn’t unseat such a divisive legislator.

“I think they’re either really in love with Trump or they’re afraid of change,” Sandy Darling, a 70-year-old from Fort Dodge, Iowa and Scholten supporter, said of her district. She noted that when she was working the phones for Scholten on Sunday, voters told her they didn’t believe allegations that King had aligned himself with white supremacists. “I’m dumbfounded.”

King lost Woodbury County, where one of the largest cities in the district, Sioux City, is located, and Story County, home to Ames and Iowa State University, by a large margin. However, he safely won places like Sioux and Lyon counties by 48 percentage points and 46 percentage points, respectively, according to Politico. Ninety-three percent of Sioux County’s nearly 34,000 residents are white, according to government data, while Lyon County, home to about 11,500 people, is nearly 98 percent white.

Tuesday’s razor-thin margin of victory could be worrisome for King, given that he has never faced such a close race since first being elected in 2002. And losing Woodbury County was surprising to some, as it’s gone safely to King in previous elections.

“Congressman King’s margin was closer than I know he would have liked,” said Suzan Stewart, chair of the Woodbury County GOP. However, she partially blamed “Hollywood money” pouring in for King’s opponent in the last several days of the election. Scholten’s campaign said Sunday that they had raised more than $2.7 million, with $1 million of that coming in after one poll showed the race being unexpectedly tight. “Our local radio stations could hardly do their regular programming” due to the volume of ads, Stewart said.

Ahead of the election, Ritch Stolpe, the 69-year-old owner of the archery shop Briar & Bow in Sioux City, said of King that he liked “the fact he stands by his guns.” At a King rally on Saturday, supporters told VICE News they either hadn’t heard of the accusations of racism and anti-Semitism swirling around King’s campaign, or didn’t believe them.

King’s campaign almost came undone when it was reported weeks before the election that he'd met with members of an Austrian group associated with neo-Nazis. He also endorsed a Toronto mayoral candidate aligned with white nationalists. And those were only the latest in a long series of racist comments on Twitter and in media interviews over the past several years. Under renewed scrutiny leading up to the election, corporate donors like Intel, dairy company Land O’Lakes and pet food company Purina PetCare pulled future financial support for the candidate. King was outraised by Scholten all along, though, and didn’t put out new advertisements or campaign heavily throughout the district.

King had accused the media of mischaracterizing his past statements, and the meeting in Austria. The Des Moines Register, the state’s largest newspaper, was banned by King from covering his election night event, and King’s campaign called the paper a “leftist propaganda media outlet.” A reporter for the Huffington Post, Christopher Mathias, was also ejected from the event.

King’s actions were also condemned by Ohio Rep. Steve Stivers, chair of the National Republican Congressional Committee, in the week leading up to the midterms. Stivers called King’s rhetoric ”completely inappropriate” and added: “We must stand up against white supremacy and hate in all forms, and I strongly condemn this behavior.” King refused to answer a VICE News inquiry on whether he would ever state publicly that he’s not a white supremacist, calling it a “leftist” question.