The bill was passed after three days of intense debate in both chambers.
The South Carolina legislature passed a bill early Thursday to remove the Confederate battle flag from the state capitol grounds after an emotional 13-hour debate over the controversial banner.
The flag, which dates back to the 1861-65 American Civil War, is a symbol of slavery and racism for many and Southern heritage for others.
The bill, already approved by the Senate, passed a third and final vote in the House of Representatives in the early hours of the morning by a margin of 94-20 and now goes to Governor Nikki Haley to be signed into law later in the day.
Haley has said she will sign it.
The bill was passed after three days of intense debate in both chambers. The final vote was secured exactly three weeks after nine black worshippers were gunned down on June 17 during Bible study at a church with an historically black congregation in Charleston.
The battle over the banner was stoked by photos of the accused shooter posing with a Confederate flag on a website bearing a racist manifesto.