WASHINGTON, Maine — In a landmark vote for gay rights, the Senate set the stage for passage Saturday of legislation that would overturn the military ban on openly gay troops, and President Barack Obama said it was “time to close this chapter in our history”

Repeal would mean that, for the first time in American history, gays would be openly accepted by the military and could acknowledge their sexual orientation without fear of being kicked out. More than 13,500 service members have been dismissed under the 1993 law known as “don’t ask, don’t tell.”

A 63-33 test vote — 60 votes were need to advance the measure — earlier Saturday paved the way for passage, and Senate Majority Leader Harry Reid, D-Nev., said a final vote would come at 3 p.m. The House had passed an identical version of the bill, 250-174, earlier this week, so Senate approval would send the measure to the White House.

Even after the measure were to become law, the policy change wouldn’t go into effect right away. Obama and his military advisers would have certify that the change wouldn’t hurt the ability of troops to fight, and there would also be a 60-day waiting period. Some have predicted the process could take as long as a year before Bill Clinton-era policy is repealed.

Six GOP senators broke with their party in favor of repeal. Republicans supporting the bill were Sens. Susan Collins of Maine, Olympia Snowe of Maine, Scott Brown of Massachusetts, Lisa Murkowski of Alaska, George Voinovich of Ohio, and Mark Kirk of Illinois.

West Virginia Democratic Sen. Joe Manchin, the only Democrat to oppose repeal, did not vote.

Sen. John McCain, Obama’s GOP rival in 2008, led the opposition. Speaking on the Senate floor minutes before the test vote, the Arizona Republican acknowledged he didn’t have the votes to stop the bill. He blamed elite liberals with no military experience for pushing their social agenda on troops during wartime.

“They will do what is asked of them,” McCain said of service members. “But don’t think there won’t be a great cost.”

The GOP lawmakers swung behind repeal after a recent Pentagon study concluded the ban could be lifted without hurting the ability of troops to fight.