Republican Rep. Kevin Cramer has defeated Democratic Sen. Heidi Heitkamp in North Dakota, Fox News projects.

The GOP was able to flip the seat after Heitkamp voted against confirming Supreme Court Justice Brett Kavanaugh, and came under fire for releasing an ad revealing the names of sexual assault victims without their permission.

Cramer won the race by hitting her on both those issues, and on a standard Republican platform of supporting tough immigration laws, lower taxes, gun rights, pro-life policies, and deregulation.

Polling indicated a close race for some time, but Heitkamp fell behind amid the Brett Kavanaugh confirmation process, when she ultimately voted against him. She also came under fire due to a campaign ad that released names of alleged sexual assault victims without their permission.

Polling indicated the Kavanaugh controversy made a difference in deep red North Dakota, a state that President Trump won by 35 points. A Fox News poll taken days before Kavanaugh's confirmation vote found 34 percent of North Dakotans said they would be less likely to vote for Heitkamp if she voted against Kavanaugh, with just 17 percent saying it would make them more likely to vote for her.

The Kavanaugh situation was followed by a scandal in which Heitkamp's campaign released an ad listing the names of alleged sexual assault victims, some of whom said they had not given permission to release their names. Others said they had never been assaulted. Heitkamp's campaign apologized, saying the release of names was a "mistake".

Heitkamp also came under fire recently for endorsing an ad that claimed that North Dakotans with out-of-state hunting licenses could lose those licenses if they vote. Heitkamp claimed it was true, but Politifact called the Fish and Wildlife offices in North Dakota’s neighboring states, and found it to be false. Politifact rated the claim as “pants on fire” and concluded that “it’s hard to interpret this in any way except that it seeks to discourage people from voting.”

By Election Day, the result was not a surprise. Both the latest Fox News poll and the RealClearPolitics average of polls showed Cramer leading Heitkamp by nine points going into the election.

Heitkamp was known in the Senate as someone who was sometimes willing to cross the aisle. She voted for a banking deregulation bill, along with 16 other Democrats and 50 Republicans, that aimed to reduce regulations on community banks. While Heitkamp voted against Kavanaugh, she voted to confirm Trump's other Supreme Court pick, Justice Neil Gorsuch, telling CNBC, "would he be the judge I'd pick? No, never... But he is the judge that the duly elected president picked."

But on big issues like tax cuts and repealing ObamaCare, Heitkamp stood with her party. She voted for bills that included funding President Trump's proposed border wall, but she also went against defunding sanctuary cities.

President Trump campaigned for Kevin Cramer in June, holding a rally in Fargo, North Dakota. In October, the President also chimed in on Twitter: "Watched North Dakota’s Rep. Kevin Cramer easily win debate with Senator Heidi Heitkamp. Great job Kevin, you will be a great Senator!"

The author, Maxim Lott, is Executive Producer of Stossel TV and creator of ElectionBettingOdds.com. He can be reached on Twitter at @MaximLott