With all of the precincts reporting Sanford had about 57 percent of the vote in the 1st District to 43 percent for Curtis Bostic, the former county council member. The candidates were vying in the GOP runoff after they finished as the top two vote-getters in a 16-way GOP primary last month.
Sanford will face Democrat Elizabeth Colbert Busch, the sister of comedian Stephen Colbert, and Green Party candidate Eugene Platt in a May special election.
Colbert Busch released a statement late Tuesday saying "I look forward to a vigorous campaign that focuses on creating jobs, balancing our country's budget and choosing an independent-minded leader who shares the values of the great people of South Carolina."
Sanford, a former three-term congressman and two-term governor, said earlier Tuesday that the runoff would give a good indication whether voters have moved past his personal indiscretions.
"I'm both humbled and grateful for the response of the voters here tonight," he said later.
Sanford was a rising Republican political star before he vanished from South Carolina for five days in 2009. Reporters were told he was hiking the Appalachian Trail, but the then-married governor later tearfully acknowledged he was visiting Maria Belen Chapur, which he told everyone at a news conference announcing his affair. He later called her his soul mate and the two were engaged earlier last year.
After the revelation of the affair, Sanford's wife Jenny divorced him and wrote a book.