Washington (CNN) Less than three hours before South Carolina's primary polls close, President Donald Trump urged Republican voters there to oust Rep. Mark Sanford -- who has criticized him -- in favor of his more supportive challenger, state Rep. Katie Arrington.

Trump in a tweet referenced the 2009 scandal in which Sanford, then the governor, disappeared for several days. He first claimed he'd been "hiking the Appalachian Trail" but later admitted to an extramarital affair in Argentina.

Trump tweeted: "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!"

Trump's tweet came at 4:12 p.m. ET. Polls in South Carolina close at 7 p.m. ET.

But his endorsement of Arrington could be more helpful to her campaign if the two fall short of 50% of the vote and head to a runoff on June 26.

Read More