The unauthorized digging into electronic government files on politicians recalled a 1992 case in which a Republican political appointee at the State Department was demoted for searching Bill Clinton's passport records when Clinton was running against President George H.W. Bush.
McCain, the Republican nominee-in-waiting, said there should be an investigation of the new snooping as well as an apology.
Democrat Obama said that better include Congress, not just Bush administration investigators.
"When you have not just one but a series of attempts to tap into people's personal records, that's a problem not just for me but for how our government functions," Obama told reporters in Portland, Ore., where he was campaigning. "I expect a full and thorough investigation. It should be done in conjunction with those congressional committees that have oversight function so it's not simply an internal matter."
Rice was apologetic in public as well as in her private phone calls to the candidates.
"None of us wants to have a circumstance in which any American's passport file is looked at in an unauthorized way," the secretary of state said after speaking with Obama.
"I told him that I was sorry, and I told him that I, myself, would be very disturbed if I learned that somebody had looked into my passport file," she added. "And therefore, I will stay on top of it and get to the bottom of it."
In all, at least four workers were involved in the snooping.
The State Department confirmed Thursday night that Obama's files had been compromised on three occasions -- Jan. 9, Feb. 21 and as recently as last week, on March 14. By the time senior officials were made aware, two contract employees had been fired and a third disciplined, agency officials said.
The firings could make it more difficult for the State Department to force them to answer questions. Unless they agree to comply, they would have to be served with a grand jury subpoena compelling them to testify before a grand jury.
The companies that provided the contractors were The Analysis Corp. and Stanley Inc. Stanley, based in Arlington, Va., this week won a five-year, $570-million government contract extension to support passport services.
According to agency officials, a Stanley employee improperly accessed Obama's records on Jan. 9 and was fired within days. The second contractor, employed by The Analysis Corp., pried into similar records on Feb. 21 but was not terminated. The third incident involved another Stanley employee, who was swiftly fired.
Stanley officials referred all question to the State Department. The Analysis Corp., or TAC, issued a statement late Friday saying it had been notified earlier in the day that one of its contractors had acted improperly.
The company said it had decided to honor the department's request to delay firing its consultant in order to give investigators time to conduct its investigation.
"This individual's actions were taken without the knowledge or direction of anyone at TAC and are wholly inconsistent with our professional and ethical standards," wrote the company, based in McLean, Va.
Department spokesman Sean McCormack said Friday that a separate search conducted after the Obama revelation showed that workers also had snooped on McCain and Clinton.
The worker who had been reprimanded in the Obama incident had also reviewed McCain's records earlier this year, McCormack said. While the employee has not been fired, that person no longer has access to passport files, he said.
"I can assure you that person's going to be at the top of the list of the inspector general when they talk to people, and we are currently reviewing our (disciplinary) options with respect to that person," McCormack said.
In Clinton's case, someone accessed her file last summer as part of a training session involving another State Department worker. McCormack said the violation was immediately recognized and the person was admonished. That person was not involved in the later incidents, meaning four people were involved in all.
The department's internal computer system "flags" certain records, including those of high-profile people, to tip off supervisors when someone tries to view the records without an appropriate reason.
McCormack said an early review of the incidents points to workers' "imprudent curiosity" more than something more sinister.
But "we are not dismissive of any other possibility, and that's the reason why we have an investigation under way," he said.
Former independent counsel Joseph diGenova, who investigated the 1992 scandal, said the firings of the two contract employees will make the investigation more difficult because the inspector general can't compel them to talk.
"My guess is if he tries to talk to them now, in all likelihood they will take the Fifth," diGenova said, referring to the Fifth Amendment's protection against self-incrimination.
Likewise, Patrick Kennedy, the top management official at the State Department, briefed the candidates' staffs on Capitol Hill, then said to reporters, "The State Department has very, very rigorous rules about controls and access for privacy material. We review them regularly, and we have a large organization with a lot of people in it. Mistakes and errors happen from time to time. ... We caught these and we've got to work and correct that process."
Attorney General Michael Mukasey said the case has not yet been referred to the Justice Department for investigation, and indicated prosecutors were likely to wait until the State Department's inspector general concludes that inquiry. But Mukasey did not rule out the possibility of the Justice Department taking an independent look.
McCain, who was in Paris on Friday, said any breach of passport privacy deserves action.
"The United States of America values everyone's privacy, and corrective action should be taken," he said.
It was not clear whether the employees saw anything other than the basic personal data such as name, citizenship, age, Social Security number and place of birth, which is required when someone fills out a passport application.
The file also includes date and place of birth and address at time of application. Agency officials said the files generally would not list countries the person has traveled to.
"It is worth noting that that earlier situation (in 1992) also was characterized as isolated and nonpolitical when the news initially emerged," said Howard Berman, D-Calif., chairman of the House Foreign Affairs Committee.
"This time, as then, Congress will pay close attention to the depth of executive branch involvement in the rifling of presidential candidates' passport files," he added.
The Washington Times first reported the incident involving Obama.