WASHINGTON, July 1 - Justice Sandra Day O'Connor, the first woman to serve on the United States Supreme Court and a crucial swing vote on abortion and a host of other divisive social issues, announced today that she was resigning, setting up what is sure to be a tumultuous fight over confirming her successor.

After months in which speculation about the Supreme Court focused on the likelihood of Chief Justice William H. Rehnquist's stepping down, the resignation of Justice O'Connor, 75, caught much of Washington, including the White House and her own colleagues on the court, off guard. Even so, the armies of ideological activists from both sides who had massed in anticipation of a battle over replacing the chief justice, a reliable conservative, quickly pivoted to what they agreed was an even higher-stakes showdown for control of a seat that could alter the court's balance on an array of polarizing topics.

Justice O'Connor's decision creates the first vacancy on the court in 11 years, ending the longest period without a change in the line-up of justices in almost two centuries, and it provides President Bush with his first opportunity to name a Supreme Court justice. The chief White House spokesman, Scott McClellan, said the president would not make a selection until after returning from a summit meeting next week in Scotland.

It is still not clear whether Chief Justice Rehnquist, who is battling thyroid cancer, will step down this summer, creating another vacancy and expanding the confirmation battle to two fronts.