COLUMBIA, S.C. — The Confederate battle flag that has flown at the South Carolina State House for more than 50 years will soon be gone after lawmakers capped a tension-filled session early Thursday and voted to remove it from the grounds of the State Capitol.

The final vote in the State House of Representatives, 94 to 20, was well above the two-thirds majority required to move the bill to the desk of Gov. Nikki R. Haley, a Republican who called for the flag to come down after the massacre last month at the Emanuel African Methodist Episcopal Church in Charleston.

Ms. Haley’s office said that she would sign the bill into law at an event at 4 p.m. on Thursday at the State House. With Ms. Haley’s signature, the clock will begin to tick, and the state will have 24 hours to take down the flag, which will be moved to the Confederate Relic Room and Military Museum, near the Capitol.