South Carolina Gov. Nikki Haley on Thursday signed a bill to remove the Confederate battle flag from the statehouse grounds, noting the weeks of grief and compassion that have consumed the state since a gunman killed nine people at Charleston's Emanuel AME Church.

"Twenty-two days ago, I didn't know that I would ever be able to say this again," Haley said. "But today I'm very proud to say that it is a great day in South Carolina."

Haley signed the measure into law at a ceremony at the statehouse hours after the bill got final approval from South Carolina's House of Representatives.

She credited lawmakers' quick action to the example set by the victims of the shooting and their families.

"Nine people took in someone that did not look like them or act like them, and with true love and true faith, and true acceptance, they sat and prayed with him for an hour," Haley said before signing the law. "That love and faith was so strong that it brought grace to their families. It showed them how to forgive."

The flag, which has flown at the statehouse for more than 50 years, will be removed from the grounds at 10 a.m. Friday, Haley's spokesperson told the Associated Press.

The bill, which was passed on a 94–20 vote, calls for the flag to be housed in the Confederate Relic Room and Military Museum in Columbia.

"We will bring it down with dignity and make sure that it is put in its rightful place," Haley said.

The debate that started on Wednesday lasted more than 13 hours. The House discussed at length an amendment to replace the Confederate flag with the state flag, but it was narrowly rejected by a vote of 57–63.

"We saw members start to see what it was like to be in each other's shoes, start to see what it felt like," Haley said. "We heard about the true honor of heritage and tradition. We heard about the true pain that many had felt. And we took the time to try to understand it."