In losing to Arrington, Sanford became the second incumbent Republican House member to lose a primary this year. Rep. Robert Pittenger of North Carolina fell to former pastor Mark Harris last month.
Allegiance to Trump has played a prominent role in Republican House and Senate primaries across the country. Still, the president took a rare step Tuesday in publicly opposing a GOP incumbent from his own party.
While the effect of Trump's last-minute endorsement is unclear, Arrington's winning campaign strategy showed the president's firm grip on his party's direction. Arrington, who is favored to win the general election in the red district, made supporting Trump a centerpiece of her primary run. In her victory speech, she declared "we are the party of Donald J. Trump."
In conceding the race, Sanford defended his disagreements with Trump.
"It may have cost me an election, but I stand by every one of those decisions to disagree with the president, because I didn't think they would be concurrent with the promises I made when I first ran for office and for the very voices of the people of the 1st District that I represent," he said Tuesday night, according to the Charleston-based Post and Courier newspaper.
Sanford largely voted with Trump in Congress. But he broke with the president by opposing the $1.3 trillion spending bill passed earlier this year and the GOP-written farm bill that fell in the House.
The congressman has also criticized Trump's effect on political discourse. Following the shooting of House Majority Whip Steve Scalise last year, Sanford said Trump is "partially to blame for demons that have been unleashed."
Just last week, a different Trump critic struggled in a red-state primary election. GOP Rep. Martha Roby, running in Alabama's 2nd District primary, failed to garner 50 percent of the vote and was forced into a runoff with ex-congressman Bobby Bright.
In 2016, she pulled her endorsement from Trump after the revelation of the "Access Hollywood" tape in which the president bragged about touching women without their consent.