After preparing for months for a battle to replace Chief Justice William H. Rehnquist, conservative and liberal groups were caught by surprise yesterday and immediately began reworking their strategies for a fight that they believe will be even more ferocious and carry higher stakes.

Activists on both sides said the retirement of Justice Sandra Day O'Connor, who has been a crucial swing vote compared with Rehnquist's reliable conservatism, gives conservatives an unexpected chance to shift the court rightward. Liberals, anxious to prevent such a move, said they must pour more money and energy into a campaign to educate Americans about the role O'Connor played and the importance of replacing her with a fellow centrist.

The multimillion-dollar campaigns, which activists say will nearly rival presidential candidacies in their scope and sophistication, kicked off within an hour of O'Connor's announcement. Both sides launched ads designed to build momentum for their causes before President Bush names his nominee, which some senators expect during the week of July 11.

The liberal MoveOn PAC began airing a television ad in five states recalling the president's role in the Terri Schiavo case and asking, "Will George Bush choose an extremist who will threaten our rights?"

The conservative group Progress for America, which spent $45 million on Bush's reelection, sent an e-mail to 8.7 million people about 45 minutes after the news broke, urging them to distribute a Web video mocking anticipated Democratic attacks. The group said it is rethinking its plan to refrain from airing TV ads next week.

Tony Perkins, president of the conservative Family Research Council, said his group plans to spend millions of dollars on the fight and will increase the budget and intensity because of the O'Connor opening. "To replace Justice Rehnquist with a nominee who respects the Constitution would be the status quo," Perkins said. "To replace Justice O'Connor with a nominee who respects the Constitution would change the composition of the court."

Nan Aron, head of the liberal coalition Alliance for Justice, said, "It's hard to overstate the stakes now with Justice O'Connor's resignation." Liberal activists, she said, must embark on a crash education course to tell Americans about potential changes in rulings on abortion, the environment, workers' rights and many other issues. "We need to share with the American people the importance of her seat . . . and secure their engagement in this national debate," Aron said.

The timing of O'Connor's announcement was awkward for senators, who will vote -- presumably in the early fall -- on whether to confirm Bush's pick to succeed her. Senators had met late into the night Thursday to begin their week-long Fourth of July recess yesterday, and most were gone or about to leave Washington when the word came at 10:30 a.m. At least one, Sen. Charles E. Schumer (D-N.Y.), quickly jetted back to hold a Capitol news conference, where he urged the president to convene "a summit" of senior Republican and Democratic senators to consult on a possible nominee.

The White House said Bush will meet with a few top Republican and Democratic leaders, including those on the Senate Judiciary Committee, before announcing his choice. Bush placed a 14-minute call to Sen. Patrick J. Leahy (Vt.), the committee's ranking Democrat, that forced the senator to interrupt his news conference in Burlington, Vt. But White House aides stopped far short of promising a "consensus" nominee, which Democrats and liberals called for throughout the day.

Several Democrats noted that President Ronald Reagan, a conservative icon, had nominated O'Connor, who was approved by the Senate 99 to 0. "This president should follow the Reagan standard," said Sen. Christopher J. Dodd (D-Conn.).

"President Bush should use this opportunity to bring the country together, not to tear us apart," said Senate Minority Leader Harry M. Reid (D-Nev.). "It's what President Reagan did when he nominated Justice O'Connor." But some Republicans urged Bush to nominate a strong conservative, even if it means a bruising confirmation fight in the Senate, where the GOP holds 55 of the 100 seats.

"While it may seem expedient to nominate people who can easily be confirmed by the U.S. Senate, history shows that is not the proper course of action," said Rep. Zach Wamp (R-Tenn.). Sen. Tom Coburn (R-Okla.) said: "I would hope that President Bush's nominee will swing the court back toward the Constitution and away from an era of self-indulgent judicial activism."

Activists on both sides will closely watch the seven Senate Democrats and seven Republicans who crafted a deal in May that ended Democratic filibusters of several appellate court nominees and thwarted a bid by Majority Leader Bill Frist (R-Tenn.) to outlaw such filibusters. The Democrats have promised not to filibuster a Supreme Court nominee except in "extraordinary circumstances." The seven Republicans have promised to block any effort to ban such filibusters as long as the Democrats keep their bargain.

The pact has prompted widespread debate on the meaning of "extraordinary circumstances," with liberals defining it loosely in hopes of giving themselves maximum leeway to combat a staunchly conservative nominee.

Sen. Ben. Nelson (D-Neb.), who helped to shape the agreement, said in a statement: "Once a nominee is put forward, I'm sure the 'Gang of Fourteen' senators will meet and begin discussions about the nominee to ensure that the agreement we reached will remain intact. Any speculation on potential nominees is obviously premature."

Another member of the group, Sen. Mark Pryor (D-Ark.), told reporters in a conference call that the 14 senators knew their pact would be sternly tested. "If President Bush wants to test the agreement by sending a very, very conservative nominee without consulting with senators," he may do so, Pryor said. But he added: "We do not want to see 'extraordinary circumstances.' "

Activists in both camps maintained a frantic pace of conference calls, e-mails and meetings to frame their messages and coordinate their campaigns. Frist's chief of staff, Eric Ueland, met with conservative interest groups in a Senate office building and laid out the Republicans' strategy and proposed timetable, which anticipates committee hearings this month and floor debate in September.

Conservatives, saying they have been cowed at times in the past by the left's tactics and rhetoric, vowed to be immediately aggressive. Sean Rushton, executive director of the conservative Committee for Justice, said that a victory in the battle to succeed O'Connor "would really buck up the movement and thrill and enhance our base."

The Independent Women's Forum, which is conservative but does not take a position on abortion, announced that it will work closely with the pro-Bush coalition to put women on television who will portray the president's choice as mainstream. "We know NOW [the National Organization for Women] will be everywhere," said Barbara Comstock, a consultant and legal strategist for the group. "They have been crying wolf for 20 years, and we're going to counter them."

All the time and money spent on campaigns may have little influence on the outcome, said several senators, because they and their colleagues see a Supreme Court vote as a deeply personal and principled decision. When a reporter asked Judiciary Committee Chairman Arlen Specter (R-Pa.) how public expectations might influence the battle, he replied: "There are so many publics, and so many expectations."

Staff writer Alan Cooperman contributed to this report.