Washington (CNN) Rep. Mark Sanford, a South Carolina Republican who's a critic of President Donald Trump, will lose his GOP primary to his conservative challenger, state Rep. Katie Arrington, CNN projects.

The outcome -- one that national Republicans working on House races said as recently as Tuesday morning they did not anticipate -- is another sign that GOP primary voters are rejecting lawmakers who break with Trump.

Trump endorsed Arrington hours before the polls closed Tuesday in a tweet attacking Sanford for being "very unhelpful to me in my campaign to MAGA."

Last week in Alabama, GOP Rep. Martha Roby -- who had called on Trump to exit the 2016 race after the "Access Hollywood" tape became public -- was held under 50% in her primary and forced into a runoff.

On Tuesday night, Sanford told supporters gathered in Mount Pleasant, "I've always been a realist, and at this point, based on the numbers I see, I think that I'll end up losing this election."

In his tweet, Trump referenced a 2009 scandal in which Sanford, then the governor, disappeared for several days. He first claimed he'd been "hiking the Appalachian Trail" but later admitted to an extramarital affair in Argentina.

Trump tweeted: "Mark Sanford has been very unhelpful to me in my campaign to MAGA. He is MIA and nothing but trouble. He is better off in Argentina. I fully endorse Katie Arrington for Congress in SC, a state I love. She is tough on crime and will continue our fight to lower taxes. VOTE Katie!"

Arrington also used the sex scandal in her campaign.

In one ad, Arrington tied the two chief arguments against him -- insufficient support for Trump and the scandal -- together.

"Mark Sanford and the career politicians cheated on us," she said in one ad, complaining that Sanford makes it a habit to "go on CNN to bash President Trump."

"Bless his heart, but it's time for Mark Sanford to take a hike -- for real this time," Arrington said in the ad.

Sanford has at times criticized Trump and didn't back off that criticism in debates with Arrington.

His critiques of Trump have often focused on the President's style. After the shooting at congressional Republicans' baseball practice, Sanford on MSNBC said Trump is "partially to blame for demons that have been unleashed" in American politics. In 2017, Sanford told Politico that Trump had "fanned the flames of intolerance." He also called it "befuddling" that with Trump "facts don't matter."

Sanford addressed Trump's tweet Tuesday night, saying it's "fairly unusual" for a president to weigh in as Trump did and saying he's "neither for nor against Trump," but instead bases his decisions and comments on his political values.

"It may cost me an election in this case but I stand by every one of those decisions to disagree with the president," Sanford said.

The race was perhaps the most closely watched matchup in Tuesday's slate of primaries, which includes Virginia, Nevada and North Dakota choosing their Senate candidates and Maine for the first time trying -- and voting on whether to keep -- a new voting system in which voters rank their preferences, rather than only selecting one.

Sanford, who has never lost a race before, is also the second incumbent House member to lose in a primary. Rep. Robert Pittenger was ousted in North Carolina last month.

Advocate for Confederate symbols wins in Virginia

Corey Stewart, the bombastic conservative who built his public image on championing Confederate symbols, will win the Republican Senate nomination in Virginia, CNN projects.

Stewart, a member of the Prince William County Board of Supervisors, defeated state House member Nick Freitas and minister E.W. Jackson in Tuesday's primary.

He will face Democratic Sen. Tim Kaine, the party's 2016 vice presidential nominee and a heavy favorite for re-election, in November's midterm election.

Tuesday's House races

CNN has also projected the primary winners in three House races where Democrats are hoping to unseat Republicans in the fall.

In Virginia's 2nd Congressional District, Democrat and veteran Elaine Luria will face incumbent Republican Rep. Scott Taylor, also a veteran. Taylor, who has been critical of Trump in the past, overcame a primary challenge to win the nomination.

Democrat Abigail Spanberger, a former CIA operative, won her primary in Virginia's 7th Congressional District to face incumbent Rep. David Brat in the fall.

And in Virginia's 10th Congressional District, state Sen. Jennifer Wexton won the Democratic nomination to unseat Republican Rep. Barbara Comstock, who also overcame a primary challenge. Comstock is seen as one of the most vulnerable Republican members of Congress in November.

In South Carolina, Archie Parnell won the Democratic primary in the 5th District despite admitting to domestic abuse in the 1970s. Local, state and national Democrats have called on him to drop out of the race in the deep-red district and said they wouldn't support him if he won.

In Nevada, the parties will choose their nominees in two competitive open seats. In the 4th District, vacated by retiring Rep. Ruben Kihuen, Steven Horsford, a former congressman, will be the Democratic nominee. Another former congressman, Cresent Hardy, is the favorite to be the Republican in the race.

And in the 3rd District, philanthropist Susie Lee won the Democratic primary, CNN projects, while Republicans could choose Danny Tarkanian, the son of the legendary UNLV basketball coach Jerry Tarkanian, who dropped his Senate bid at the urging of Trump.

Three states pick Senate candidates

The Senate landscape is becoming more settled Tuesday night as well.

As expected, North Dakota Republicans chose Rep. Kevin Cramer to challenge Democratic Sen. Heidi Heitkamp.

In Nevada, Democrats tapped Rep. Jacky Rosen to take on Republican Sen. Dean Heller.

Both primaries were sleepy, but the two states will be among the nation's most competitive Senate battlegrounds in the fall.

Governor races take top local billing

In South Carolina, Republican Gov. Henry McMaster -- an early and vocal supporter of Trump who replaced former Gov. Nikki Haley -- fell short of 50% and is headed to a June 26 runoff with the second-place finisher, businessman John Warren.

Democrats, meanwhile, nominated state Rep. James Smith, a Joe Biden ally, to take on the Republican winner.

In Nevada, the race to replace outgoing Republican Gov. Brian Sandoval features primaries in both parties.

Democrats will choose between two Clark County commissioners -- Steve Sisolak, a moderate backed by former Sen. Harry Reid, and Chris Giunchigliani, who was endorsed by Hillary Clinton and is a woman, which has proven to be a decisive advantage in earlier Democratic contests this year.

Republicans, meanwhile, chose Adam Laxalt, the state's attorney general and the son of former New Mexico Sen. Pete Domenici and Michelle Laxalt, the daughter of former Nevada governor and senator Paul Laxalt, CNN projects.