A US Republican congressman and Donald Trump critic who survived a sex scandal lost his re-election bid Tuesday hours after the president launched a scorching personal attack against the lawmaker from his own party.
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.
With 98 percent of the vote counted, US media called the race for state representative Katie Arrington, who led Sanford by 50.5 percent to 46.5 percent.
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 he 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.
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.
"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.