The 36-3 vote Tuesday now sends the bill to the House, where it faces a less certain future. Republicans met behind closed doors Monday and struggled to reach a consensus on what to do next.
The Senate bill would remove the Confederate flag flying in front of the Statehouse and the flagpole as soon as the governor signs it.
Republican Gov. Nikki Haley urged lawmakers to remove the flag after the killing of nine black people in a historic African-American church in Charleston last month by a gunman police say was motivated by racial hatred.
The suspect was photographed several times with the Confederate flag.