COLUMBIA, S.C. — Closing a chapter on a symbol of the Deep South and its history of resistance and racial animus, South Carolina on Friday lowered the Confederate battle flag from outside its State House, where it had flown for more than 50 years.

The flag came down amid heavy security and loud cheers at a Friday morning event that followed days of emotional debate in the State Legislature and, on Thursday, the final approval of Gov. Nikki R. Haley, who had pledged that the symbol would be lowered “with dignity.”

The Confederate battle flag on the grounds of the State House in Columbia, S.C., a day before its removal. Credit Stephen B. Morton for The New York Times

The Confederate battle flag on the grounds of the State House in Columbia, S.C., a day before its removal. Credit Stephen B. Morton for The New York Times

Shielded across the decades by both Democrats and Republicans, the flag left its pole outside the State House only 23 days after nine black churchgoers were killed at Charleston’s Emanuel African Methodist Episcopal Church.