"It has been a great privilege indeed to have served as a member of the court for 24 terms," the 75-year-old justice wrote President Bush in a one-paragraph resignation letter. "I will leave it with enormous respect for the integrity of the court and its role under our constitutional structure."
In a separate one-sentence statement, O'Connor cited her age and said she "needs to spend time" with her family. She and her husband, John, a former classmate at Stanford, have three sons.
President Bush, in a brief statement at the White House, praised O'Connor as "a discerning and conscientious judge and a public servant of complete integrity."
He offered no hints about a possible replacement but said he would make his choice in a "timely manner" so there can be a Senate vote before the next court term begins in October.
The White House said later that the president will not decide on a nominee before he returns from Europe on July 8.
The surprise announcement from O'Connor came amid widespread speculation that ailing Chief Justice William H. Rehnquist would step down. The 80-year-old Rehnquist has thyroid cancer and was absent from the bench during much of the court's just-completed session.
Rehnquist has offered no public clue as to his plans.
It's been 11 years since the last opening on the court, one of the longest uninterrupted stretches in history. O'Connor's decision gives Mr. Bush his first opportunity to appoint a justice and could lead to a nasty confirmation fight for the person he nominates.
"This is an earth shaker," said CBS News Correspondent Jim Stewart.
"This is the fight this town has been bracing for for a long time," Stewart said. "You can expect a major fight."
CBS News Legal Analyst Andrew Cohen said O'Connor's departure is "far more significant" than the conservative Rehnquist's would have been.
"She was the pivotal 'swing' vote on many of the most contentious issues of the day, from affirmative action to abortion rights, from campaign-finance reform to federal disability access law, from gay rights to the death penalty," said Cohen.
"Because of her centrist role on the court, she alone is probably more responsible for the laws and rules that govern more Americans than any other living citizen," he said.