Scott Compton made the announcement in a release issued jointly with Lexington-Richland District 5, The (Columbia) State reported.
Compton, who has been on administrative leave with pay, cited personal and family reasons for quitting his teaching position at Chapin High School, the newspaper said.
Compton, a seven-year member of the staff at the school, found himself on the hot seat after he took a U.S. flag off a classroom wall and stomped on it during three classes in December.
"Both Mr. Compton and the district agree that his resignation is at the best interest of everyone who was directly involved in this matter," the release stated.
The district had fired him Jan. 15, but he was appealing so was still an employee, The State said.
District Superintendent Stephen Hefner, who recommended Compton be dismissed, said in his dismissal letter the teacher had exhibited "a pattern of poor judgment."
Compton's attorney, Darryl Smalls, has said his client had not intended to be disrespectful and his stomping on the flag was an attempt to show students the nation is more important than its symbols.
The State said Compton isn't the only Lexington-Richland 5 teacher to get in trouble this school year.
Dutch Fork High School social studies teacher Laurie Humphrey was kept out of her classroom for a week after putting up a sign shortly before the Nov. 6 election saying "the road to hell is paved with Democrats."
Humphrey still works for the district, The State said.
Iranian woman stops the execution of son's killer
Members of Congress to keep receiving porn magazine