Sanford, who served as governor of the Palmetto State from 2003 to 2011, defeated businesswoman Elizabeth Colbert Busch (D). Sanford had said Tuesday that if he did not win, he would not run for office again, the Associated Press reported.
For a county-by-county breakdown of how the race went down, click here.
More from The Associated Press:
Sanford, who turns 53 later this month, has never lost a race in three runs for Congress and two for governor. And he said before the votes were counted Tuesday that if he lost this race, he wouldn't run for office again.
"I think you can go back in and you can ask for a second chance in a political sense once," he said Tuesday after voting in the special election.
Sanford saw his political career disintegrate four years ago when he disappeared for five days, telling his staff he was hiking the Appalachian Trail. He returned to admit he had been in Argentina with his mistress – a woman to whom he is now engaged. Sanford later paid a $70,000 ethics fine, the largest in state history, for using public money to fly for personal purposes. His wife, Jenny, divorced him.
Green Party candidate Eugene Platt also ran.
Sanford's 1st District, slightly reconfigured from the one he held for three terms in the 1990s, is strongly Republican and Mitt Romney took it by 18 points in last year's presidential race. But Sanford had to battle against his own past indiscretions and a well-financed campaign mounted by Colbert Busch in which she outraised her Republican rival.
Three weeks before the special election, news surfaced that Sanford's ex-wife had filed a court complaint alleging he was in her house without permission in violation of their divorce decree, leading the National Republican Congressional Committee to pull its support from the campaign. Sanford must appear in court Thursday on the complaint.
Sanford said he tried to get in touch with his ex-wife and was in the house so his youngest son would not have to watch the Super Bowl alone.
The seat became vacant when U.S. Sen. Jim DeMint resigned from his Senate seat late last year. Governor Nikki Haley then appointed the sitting congressman, Tim Scott, to fill DeMint's seat.
Colbert Busch had said after she voted in Mount Pleasant, across the Cooper River from Charleston, that she felt positive and encouraged. But in the end, despite Sanford's past being an issue for some voters, she was defeated.
Gabriel Guillard, 49, a massage therapist and teacher, said she liked Colbert Busch but would have voted for anyone but Sanford.
"I would do anything to make sure Mark Sanford doesn't get back in because of his past behavior," she said. "And I am so tired of South Carolina being a laughingstock. I'm so sick of it."
Others didn't let the past dictate. Marion Doar, 79 and retired from careers in the military and business, said he voted for Sanford.
"Sanford was a fine fellow," he said. "He still is a fine fellow. Following his heart as he did was foolish but it happens."
Sanford already has survived a 16-way GOP primary with several sitting state lawmakers and Teddy Turner, the son of media magnate Ted Turner. He also won the primary runoff. Colbert Busch defeated perennial candidate Ben Frasier with 96 percent of the vote in the Democratic primary.
Colbert Busch, 58, picked up the endorsement of The Post and Courier over the weekend. The Charleston newspaper called her "a welcome tonic" for those who suffer from "Sanford Fatigue – a malady caused by overexposure to all of the cringe-worthy details of his 2009 disgrace as governor, his ongoing efforts for redemption via the political process, his resurgent personal problems, etc."
Sanford, despite losing national GOP support, picked up the endorsement of Kentucky Sen. Rand Paul, a tea party favorite who is well-known in the district.