Rep. Mark Sanford (R-SC) conceded to his opponent, state lawmaker Katie Arrington, late Tuesday after President Trump endorsed her and mocked Sanford on Twitter just three hours before the polls closed.

BREAKING: Katie Arrington wins Republican nomination for U.S. House in South Carolina's 1st congressional district. #APracecall at 12:09 a.m. EDT. #Election2018 #SCprimary pic.twitter.com/T4RqkrmubV — AP Politics (@AP_Politics) June 13, 2018

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! — Donald J. Trump (@realDonaldTrump) June 12, 2018

The President was referencing Sanford’s disappearance in 2009 when he was South Carolina governor. He claimed he was hiking the Appalachian Trail, but was in Argentina with his mistress. The incident did result in censure from the South Carolina General Assembly, but Sanford did not resign over it.

Tuesday’s defeat marks the first time he has lost an election in South Carolina since he ran for Congress for the first time in 1994.

Sanford conceded the race late Tuesday and commented on Trump’s tweet.

"It's fairly unusual for a president to tweet in a congressional race. I don't know the last time it's happened in a Republican primary but it happened today," he said.

He said he does not regret being critical of Trump.

"A lot of people have come up to me in the course of this campaign and asked me, 'Are you for or against Trump?' And I'd say, 'I'm neither for nor against Trump. I'm for ideas that I've long stood for in my entirety of my time in office,'" he said.

"It may have cost me an election,” he added, “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."