WASHINGTON — With Democrats facing a November election in which 24 of their Senate seats are up for a vote, the North Dakota seat, now held by Democratic Sen. Heidi Heitkamp, is within the grasp of the Republican Party – and experts expect the battle to get ugly.

Although the state’s Democratic and GOP primaries are in June, Heitkamp is expected to be her party’s nominee. But Republican Rep. Kevin Cramer’s surprise February announcement that he would try to unseat her, one month after he had ruled out the idea, has put the seat back in the toss-up category.

David Byler, elections analyst for RealClearPolitics, said Cramer is the Republicans’ best bet to unseat Heitkamp because of his popularity. Cramer has served three terms in North Dakota’s at-large congressional district, winning each election with increasingly large margins.

Heitkamp is now one of the more vulnerable Democratic nominees in the upcoming midterm elections and one of 10 Democrats defending a Senate seat in a red state; Trump carried North Dakota by 36 points in the 2016 election.

The Senate has 51 Republicans and 47 Democrats, plus two independents who caucus with the latter. Though Democrats only need to win two more seats to gain control of the Senate, they have 24 seats up for election, including the two independents, while the Republicans only have nine.

North Dakota’s demographics clearly favor a Republican candidate. The state lacks the groups that typically make up the Democratic Party’s core constituencies, including ethnic minorities, the LGBT community and educated urbanites. At the same time, Byler said, Heitkamp is a “high-quality candidate.”

The most recent poll, a survey of 821 state residents by news site Axios, found a generic Republican candidate having a 2-percentage point lead over Heitkamp, a difference that is well within the margin of sampling error.

Heitkamp has had a tumultuous relationship with Trump, something that may threaten her re-election bid. She voiced an overwhelming support for Hillary Clinton during her campaign — saying Clinton “transcends gender” and would make an “excellent president” — and has also pushed against Trump on several key votes throughout his 14-month tenure, including his nomination of Betsy DeVos for secretary of education, the tax reform bill and his multiple attempts to repeal the Affordable Care Act.

According to news website FiveThirtyEight, Heitkamp has voted in line with Trump’s position on 55.2 percent of the votes so far, though, which include congressional proposals and Cabinet and Supreme Court nominations.

Byler said that while it’s important to look at Heitkamp’s record on seminal votes that have shaped Trump’s presidency, it’s also worthy to note her position on issues that may generate more headlines in the future. Heitkamp, along with three other Democratic senators in conservative states, has an “A” rating from the National Rifle Association for her consistent support of pro-gun legislation, going against the Democratic Party’s views. She has also sided with Trump on his energy platform, including on his approval of the Keystone XL pipeline, which she called “common sense.”

Heitkamp must find a way to satisfy both the president and her party in order to cling to her Senate seat for another six years, Byler said.

“She’s trying to walk this fine line that’s hard to walk, but that talented politicians like her can,” he said. “It’s a balancing act.”

On the other hand, Cramer has been a close Trump ally since the start. As one of the president’s energy advisers and a self-described “climate skeptic,” Cramer has influenced several environment decisions Trump has made in his tenure, including pulling the United States out of the international Paris climate agreement. He’s also pro-gun, pro-border control and anti-abortion, all attitudes that have proven to play well in a conservative state like North Dakota.

And, unlike Heitkamp in the Senate, Cramer has sided with the president on 98.5 percent of votes that have been brought to the House floor, opposing his views only on a bill to impose sanctions on Russia, Iran and North Korea.

Byler said a viable strategy for Cramer to win is to both turn the race into a “generic Republican versus a generic Democrat” contest — as the state’s basic partisan alignment would guarantee him the victory — and rely on his record to appeal to voters.

“North Dakota is a small state,” Byler said. “A lot of people really expect to know the politicians that are running, know the people who are representing them. As a politician in that state, [Cramer] is probably going to use his own local ties, party apparatus, so on and so forth to gain an advantage.”

Heitkamp, though, will have to rely on a significant amount of crossover voting to remain in the Senate. Heitkamp faced a similar challenge during her first run for the seat in 2012, when she beat Republican Rep. Rick Berg by a single percentage point and fewer than 3,000 votes.

Bo Wood, a professor of political science and public administration at the University of North Dakota, expects both candidates to adopt a hostile approach in their campaigns. He said this strategy worked for Heitkamp’s first Senate race, when she attacked Berg’s character, endorsements and business background.

“It’s going to boil down to an ugly negative campaign with lots of name calling and mud smudging, and whoever is better at it will emerge as the winner,” he said.

The other candidates in the primaries are Democrat Dustin Peyer, a firefighter, and Republican Thomas O’Neill, the former mayor of Niagara, North Dakota.

According to OpenSecrets.org, a nonpartisan research group that tracks campaign contributions, Heitkamp has more than six times the budget that Cramer does, with $11.8 million in contributions and cash-on-hand money so far. Cramer has $1.8 million, with Republicans likely to make greater efforts toward raising more funds for his campaign.

Wood said if the North Dakota Senate race ends up looking very tight as the election nears, the money both parties will pour into their candidates’ campaigns will be “like we’ve never seen before.” If it becomes obvious to either party that it cannot win the majority, though, he said funds coming into North Dakota from outside donors will dry up.

“If Kevin Cramer calls the Republican National Party and says, ‘You know what, we have a chance to win here but [Heitkamp] is out there spending money that’s 2 to 1, then the money will come,” Wood said. “I cannot see a scenario where they would not put in whatever it takes, as long as they believe that seat can deliver the majority in the Senate.”

Though Byler and Wood agree that the Democrats’ race to win the Senate majority will be difficult, Byler said the party may capitalize on Trump’s low approval ratings and pull off major upsets even in traditionally red states, the way it recently did in Alabama, as long as there is a large voter turnout.

“Midterm turnout is lower than presidential elections just as a general rule and that drop off usually favors Republicans,” Byler said. “But given the national environment and the enthusiasm that we’ve seen on the Democratic side, it’s hard to see what the makeup of the 2018 electorate is going to be.”