The landmark decision comes after nine black churchgoers were killed in a church shooting in Charleston by a gunman who police say was motivated by racial hatred and was photographed with the Confederate flag.
The flag will be pulled down from the Capitol's front lawn and the flagpole it flies on during a ceremony Friday morning, said Chaney Adams, a spokeswoman for Governor Nikki Haley. Then, the banner will be taken to a local history museum for display.
Haley will sign the bill — which passed the state House early Thursday after 13 hours of debate —Thursday afternoon in the Statehouse lobby. The measure requires that the flag come down within 24 hours of her signature.
After the House's 93-27 vote, there were hugs, tears and high fives in the chamber. Members snapped selfies and pumped their fists. But even among the celebrations, there was sadness.
After the Civil War, in which the pro-slavery South seceded and fought northern states, the flag was first flown over the dome of South Carolina's Capitol in 1961 to celebrate the 100th anniversary of the war. It stayed as a protest to the Civil Rights movement that sought to end discrimination against blacks, only moving in 2000 from the dome to its current location.
"I am 44 years old. I never thought I'd see this moment. I stand with people who never thought they would see this as well," said Todd Rutherford, a top Democratic state legislator, who called the victims martyrs. "It's emotional for us not just because it came down, but why it came down."
As House members deliberated well into the night, there were tears of anger and shared memories of Civil War ancestors. Black Democrats, frustrated at being asked to show grace to Civil War soldiers as the debate wore on, warned that the state was embarrassing itself.
Republican lawmaker Jenny Horne reminded her colleagues she was a descendent of Confederate President Jefferson Davis, but she scolded fellow members of her party for stalling the debate with dozens of amendments.
She cried as she remembered Senator Clementa Pinckney, the state legislator and pastor at the Charleston church, who was killed along with his parishioners.
"For the widow of Sen. Pinckney and his two young daughters, that would be adding insult to injury and I will not be a part of it!" she screamed into a microphone.
Opponents of removing the flag talked about grandparents who passed down family treasures and lamented that the flag had been "hijacked" or "abducted" by racists.
Republican Mike Pitts, who remembered playing with a Confederate ancestor's cavalry sword while growing up, said that for him the flag is a reminder of how dirt-poor Southern farmers fought Yankees not because they hated blacks or supported slavery, but because their land was being invaded.
Those soldiers should be respected just as soldiers who fought in the Middle East or Afghanistan, he said, recalling his own military service. Pitts then turned to a lawmaker he called a dear friend, recalling how his black colleague nearly died in Vietnam.
Black lawmakers told their own stories of ancestors. Democratic legislator Joe Neal talked about tracing his family back to four brothers, brought to America in chains to be bought by a slave owner named Neal who changed their last names and pulled them apart from their families.
"The whole world is asking, is South Carolina really going to change, or will it hold to an ugly tradition of prejudice and discrimination and hide behind heritage as an excuse for it," Neal said.
The governor issued her own statement. "It is a new day in South Carolina, a day we can all be proud of, a day that truly brings us all together as we continue to heal, as one people and on," she said.