The South Carolina senate has voted to remove the Confederate flag from a pole on the statehouse grounds, though the proposal still needs approval from the state's house of representatives and the governor.

Lawmakers had largely ignored calls to remove the rebel flag until the killing of nine black people during a bible study at a historic African-American church in Charleston on June 17.

The bill requires a two-thirds vote in each chamber of the legislature. The Senate approved it 37-3 yesterday, but the bill still needs approval from the state House. Republican governor Nikki Haley has said she wants the flag to come down and will sign the bill.

The vote comes less than a week after the 15th anniversary of South Carolina taking the flag off the capitol dome where it had flown since the early 1960s and moving it to beside a monument honouring Confederate soldiers.

The senate rejected a pair of amendments: one that would only fly the flag on Confederate Memorial Day, and one that would leave the flag's fate up to a popular vote.

State senator Lee Bright, who suggested the popular vote amendment, said the Confederate flag has been misused by people like Dylann Roof, who is charged with nine counts of murder in the church shootings and posed in pictures posted online with the rebel banner.

A survey asking lawmakers how they intend to vote after Ms Haley's call to remove the flag found at least 33 senators and 83 house members agreed with her, satisfying the two-thirds majority required by law to alter the flag's position.

Some Republicans want to keep the flagpole and put a different flag on it. Suggestions have included the US flag, the South Carolina flag and a flag that may have been flown by Confederate troops but does not have the same connections as the red banner with the blue cross and white stars.

Democrats have said they cannot support any flag linked to the Confederacy. Ms Haley and business leaders agree.