CHARLESTON, S.C. - South Carolina's Senate passed legislation Tuesday to remove the Confederate battle flag from the state house, where it has flown for five decades despite being viewed by many as a symbol of slavery.

A bill to banish the flag from the Capitol grounds to a museum easily passed a third and final vote in the Senate by a 36-3 margin and is now headed for debate in the state's House of Representatives.

The legislation, deemed a non-starter only months ago, has garnered strong bipartisan support after the June 17 killings of nine African-American churchgoers during Bible study at Emanuel African Methodist Episcopal church in the port city of Charleston, about two hours south of the state capital Columbia.     Photos of the white man charged in the shooting showed him posing with the flag on a website that also carried a racist manifesto.

Support for the flag has evaporated in a wave of sympathy for the victims and their families, who were widely acclaimed for expressing unconditional forgiveness for the shooter at his bond hearing less than 48 hours after the murders.

Several politicians say the shootings opened their eyes to the divisive nature of the flag and what it means to South Carolina's black population.

"The world changed on ... June 17, not only for the victims and their families, but the entire world took notice," said Senator Joel Lourie, a white Democrat.

"Let today be the beginning of a new story about the state of South Carolina ... a story of how we removed a symbol (and) helped heal a nation and a state in their mourning," he said on the Senate floor on Monday.

While most politicians recognize the flag is part of South Carolina's heritage, honoring those who died for the southern Confederacy in the U.S. Civil War, many agree it should not be flown in public places.

The bill may face a stiffer challenge in the House of Representatives but is still expected to pass and could be approved as early as Thursday. South Carolina's Republican governor, Nikki Haley, says she will remove the flag immediately if the law is passed.

The flag was raised atop the State House in 1961 in what critics say was a deliberate slap in the face to the black civil rights movement. It was moved in 2000 to a memorial for the Civil War dead that sits only yards from the entrance to the Capitol.