See more of the story

BISMARCK, N.D. — President Donald Trump tweeted congratulations Wednesday to Republican U.S. Rep. Kevin Cramer for his "huge win" in North Dakota's Senate primary and included a rare jab at Cramer's fall opponent, Sen. Heidi Heitkamp.

Trump tweeted his endorsement for Cramer in a race seen as critical for control of the closely divided Senate.

"We need Kevin in the Senate, and I strongly endorse him," Trump said.

Trump has been friendly to Heitkamp, and she has made her coziness with the president — who is hugely popular in North Dakota — a selling point in her re-election bid.

But Trump said in his tweet that Heitkamp "always will vote no when we need her." He blasted her for voting against last year's tax cut legislation.

Heitkamp is the only statewide elected Democrat in heavily Republican North Dakota. Before Trump's speech last year unveiling a tax cut package at a North Dakota oil refinery, Heitkamp rode with the president on Air Force One from Washington, and was among elected officials invited on stage.

"Everybody's saying: What's she doing up here?" Trump said on stage about the first-term senator, adding: "I hope we'll have your support" and calling her "a good woman."

Trump carried North Dakota by 36 percentage points in the 2016 election.

Cramer brushed aside a challenge from Air Force veteran Thomas O'Neill in Tuesday's Republican Senate primary in North Dakota. His race against Heitkamp will be far tougher. She has cultivated an independent image, and though she narrowly won her first race in 2012, she is personally popular in North Dakota.

The power of Trump's tweets was illustrated Tuesday night, when Rep. Mark Sanford of South Carolina lost his primary race. Sanford blamed a Trump tweet that sharply criticized him for contributing to his loss.

Heitkamp spokesman Julia Krieger downplayed Trump's tweet on Wednesday.

"It's no surprise that Congressman Cramer needed a lifeline reminder of an announcement made back in March," she said, referring to a news release endorsement from Trump's campaign.

"Heidi's focus will remain not on pleasing whoever is in the White House, but standing up for North Dakotans," Krieger said.

Cramer told The Associated Press that he never questioned Trump's support. He has said the president pressed him to enter the race.

Cramer said the debate over who Trump likes best was settled in the president's tweet.

"We always knew he would show up at the right time, and I think the primary was the trigger for that," Cramer said.