COLUMBIA, S.C. (AP) - US Rep. Mark Sanford has lost his seat in Congress, after being defeated in the his primary race Tuesday by Katie Arrington.

As results came in Tuesday, Sanford told a crowd in suburban Charleston: "I've always been a realist and at this point, based on the numbers I see, I'm going to lose this race."

MORE: South Carolina Primary Full Election Results

Arrington is a state representative.

Arrington says Sanford criticized Trump too much, calling him a "Never Trumper." One ad said "it's time for Mark Sanford to take a hike - for real this time." The refers to 2009, when Sanford's aides said he was hiking the Appalachian Trail while he actually visited a woman with whom he was having an affair in Argentina.

Sanford has never lost an election in South Carolina, including two terms in the U.S. House after the affair surfaced.

Hours before polls closed, President Donald Trump posted on his official Twitter account that Sanford was very unhelpful to him and was better off in Argentina.

Trump's post was made less than three hours before polls closed.