The South Carolina House approved taking down the Confederate flag from Capitol grounds early Thursday, a stunning reversal in a state that was the first to leave the Union in 1860 and raised the flag again at its Statehouse more than 50 years ago to protest the civil rights movement.

The move came after more than 13 hours of contentious debate and weeks after the deadly shootings of nine black church members, including a state senator, at a Bible study in Charleston. 

"South Carolina can remove the stain from our lives," said 64-year-old Rep. Joe Neal, a black Democrat first elected in 1992. "I never thought in my lifetime I would see this."

The House easily approved the Senate bill 94-20 and it will now go to Republican Gov. Nikki Haley, who supports it.

“Today, as the Senate did before them, the House of Representatives has served the state of South Carolina and her people with great dignity,” Haley said in a statement early Thursday. “I’m grateful for their service and their compassion. It is a new day in South Carolina, a day were can all be proud of, a day that truly brings us all together as we continue to heal, as one people and one state.”

It is possible the flag could come down Thursday or Friday, but the exact timing is unknown.

Haley had reversed her position on the flag, saying the pain, grief and grace of the families of the victims in the shooting at Emanuel African Methodist Episcopal Church caused her to realize that while some conservative whites saw the flag as a symbol of Southern price, most of the blacks who make up a third of the state's population see it as a dark reminder of a racist past.

The man charged in the shooting, Dylann Roof, brought that view home, telling survivors of the attack that he killed blacks because they were raping white women and taking over the country, according to witnesses. Roof also reportedly took photographs of himself holding the Confederate flag.

A group of Republicans mounted an opposition Wednesday to immediately removing the flag from the Capitol grounds, but at each turn, they were beaten back by a slightly larger, bipartisan group of legislators who believe there must be no delay.

As House members deliberated 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 crept into the 12th hour, warned the state was embarrassing itself.

The closest vote in the GOP-controlled body came on an amendment to place the state flat beside the monument to Confederate soldiers at the front of the Statehouse.

Changing the Senate bill could have meant weeks or even months to remove the flag, perhaps blunting the momentum that has grown since the church massacre.

Republican Rep. Jenny Horne scolded fellow members of her party for stalling the debate with dozens of amendments as she reminded them she was a distant relative of Confederate President Jefferson Davis.

She cried as she remembered the funeral of her slain colleague state Sen. Clementa Pinckney, the pastor of Emanuel African Methodist Episcopal church, who was gunned down as his wife and daughter locked themselves in an office.

"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.

Horne said she didn’t intend to speak but got frustrated with fellow Republicans.

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.

Rep. Mike Pitts, who remembered playing with a Confederate ancestor’s cavalry sword while growing up, said for him the flag is a reminder of how dirt-poor Southern families fought Yankees not because they hated blacks or supported slavery, but because their lands was being invaded.

Pitts said those soldiers should be respected just as soldiers who fought in the Middle East or Afghanistan. Pitts then turned to a lawmaker he called a dear friend, recalling how his black colleague nearly died in Vietnam.

"I'm willing to move that flag at some point if it causes a twinge in the hearts of my friends," Pitts said. "But I'll ask for something in return."

The debate began less than one day after the U.S. House voted to ban the display of Confederate flags at historic federal cemeteries in the Deep South.

House Minority Leader Todd Rutherford said Democrats were united behind the Senate bill, which would send the flag to the state's Confederate Relic Room — near the resting place for the final rebel flag that flew over the Statehouse dome until it was taken down in 2000.

Democrats didn't want any new flag going up because it "will be the new vestige of racism," Rutherford said.

After the break around 8 p.m., Rutherford said Democrats were willing to let the other side make their points, but had grown tired. He said while much had been said about ancestors of the Confederacy, “what we haven’t heard is talk about nine people slaughtered in a church.”

"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.

Other Democrats suggested any delay would let Ku Klux Klan members planning a rally July 18 a chance to dance around the Confederate flag.

"You don't have to listen to me. But there are a whole lot of people outside this chamber watching," Rep. Gilda Cobb-Hunter said.

Under the Senate proposal, the Confederate flag would have to come down within 24 hours of the governor signing the bill.

In Washington, the vote by the U.S. House followed a brief debate on a measure funding the National Park Service, which maintains 14 national cemeteries, most of which contain graves of Civil War soldiers.

The proposal by California Democrat Jared Huffman would block the Park Service from allowing private groups to decorate the graves of Southern soldiers with Confederate flags in states that commemorate Confederate Memorial Day. The cemeteries affected are the Andersonville and Vicksburg cemeteries in Georgia and Mississippi.

Also Wednesday, state police said they were investigating an unspecified number of threats against South Carolina lawmakers debating the flag. Police Chief Mark Keel said lawmakers on both sides of the issue had been threatened, but he did not specify which ones.

Fox News’ Chip Bell and The Associated Press contributed to this report.