SIMI VALLEY, Calif., May 3 -- Republican presidential hopefuls diverged sharply on abortion, stem cells and immigration in their first nationally televised debate Thursday night, with the three leading candidates all forced to defend current or past positions that are anathema to many in the party's conservative base.

Former New York mayor Rudolph W. Giuliani was the only candidate on the stage to equivocate over whether the Supreme Court should overturn Roe v. Wade, the 1973 decision that legalized abortion nationwide, and he restated his support for abortion rights.

Giuliani and Sen. John McCain of Arizona were in the minority in expressing support for federal funding of embryonic stem cell research, while former Massachusetts governor Mitt Romney was pressed to explain why he has shifted from support to opposition of abortion rights as he prepared to campaign for the White House.

The GOP candidates found much to agree on when the questions turned to foreign policy, with all but one, Rep. Ron Paul of Texas, supporting President Bush's troop buildup in Iraq and taking a hard line against Iran's pursuit of nuclear weapons. But they were critical of the president's management of the war. McCain also made it clear that he would have been far tougher in restraining spending than Bush has been.

The debate was held at the Ronald Reagan Presidential Library, and the candidates competed with one another through the 90-minute encounter to identify themselves with the late president, citing his foreign and domestic policies as models for what the Republican Party should embrace in the coming election.

"Washington changed us," said former Wisconsin governor Tommy G. Thompson. Invoking Reagan, he said the party must produce new and big ideas to win in 2008. "Ronald Reagan had an optimism and a belief that America could be stronger and better tomorrow than it is today, and he instilled that and inculcated that in every American," he said. "That's what we have to do as a party again."

The debate produced no clear winners or losers. The three candidates who top most national polls -- Giuliani, McCain and Romney -- made forceful presentations, but those struggling for attention also generally acquitted themselves well.

Giuliani appeared most out of step on the social issues. To compensate, he cited his mayoral record, saying he had governed as a conservative by cutting taxes, shrinking welfare rolls and reducing crime.

McCain generally sought to emphasize his conservative credentials but also bragged about his ability to reach out to Democrats, though his answers were often drawn straight from his stump speeches. Romney, in his first opportunity to present himself to a national audience, was both animated and energetic as he fielded questions.

The debate was exceedingly freewheeling, with scores of questions from moderators Chris Matthews of MSNBC and John F. Harris of the Politico, supplemented by questions from Americans across the country who had e-mailed their queries over the past few weeks.

Nancy Reagan watched the debate from the front row at her husband's presidential library. The candidates stood in the shadow of the Boeing 707 that served as Air Force One for Reagan and six other presidents. Next to Nancy Reagan sat California Gov. Arnold Schwarzenegger, who has been offering the GOP a distinctly different model of governing from Bush's, emphasizing centrist policies and bipartisan cooperation.