Mark Sanford, who earned national ridicule in 2012 after claiming he was "hiking the Appalachian Trail" when he was really spending time with his Argentine mistress, only to resurrect his political career with a second stint in Congress, crashed to defeat against a far-right challenger endorsed by Trump.
California in spotlight as US voters cast ballots in primaries
With 98 percent of the vote counted, US media called the race for state representative Katie Arrington, who led Sanford by 50.5 per cent to 46.5 per cent.
It was the 58-year-old's first election loss. He entered Congress in the 1990s before winning the governorship, when he was nearly felled by the sex scandal.
After winning back his old US House seat, he nurtured an independent streak, rapidly tiring of Trump's brash leadership style and reportedly branding the president's imposition of steel and aluminum tariffs "an experiment with stupidity."
In an 11th-hour primary day intervention, Trump struck back on Twitter, calling Sanford "nothing but trouble" and "very unhelpful" for advancing the Trump agenda.
Then he delivered a scathing rebuke of Sanford's personal life, writing: "He is better off in Argentina."
Sanford's defeat carries national implications as Republicans scramble to field their best candidates ahead of November's mid-term elections when they face energized Democrats desperate to retake control of Congress.
While Sanford's defiance of Trump cost him, Virginia congresswoman Barbara Comstock handily won her primary against a more conservative candidate who accused her of being a "Never Trumper."
Voters also cast ballots in Maine, Nevada and North Dakota, as the field for the mid-term elections begins to take shape.
Holocaust denier becomes Republican candidate for US Congress
Trump, saddled with low approval ratings, has emerged as a focal point in several races around the country.
Some Republicans rushed to Sanford's defense after Trump's bruising intervention.
Congressman Justin Amash called Sanford one of the most "principled" conservatives in Congress.
"And unlike you," he tweeted at Trump, "Mark has shown humility in his role and a desire to be a better man than he was the day before."
In conceding the race, Sanford said he was comfortable with the positions he took on Trump.
New face of Democrats? Women, minorities win big in primaries
"It may have cost me an election, but I stand by every one of those decisions to disagree with the president," he said, according to South Carolina media.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ