Obama said he would limit abortions in the late stages of pregnancy if there are exceptions for the mother's health. He said he knew that people who consider themselves pro-life will find his stance "inadequate."
He said the government should do more to prevent unwanted pregnancies and to help women who give birth, such as provide needed resources to the poor, as well as better adoption services.
McCain expressed his anti-abortion stand simply and quickly, saying human rights begin the instant that a human egg is fertilized. McCain, who adopted a daughter from Bangladesh, also called for making adoption easier.
Their comments came at a two-hour forum on faith hosted by the minister Rick Warren at his megachurch in Orange County, Calif. Obama joined Warren for the first hour, and Obama for the second. The two men briefly shook hands and hugged each other during the switch.
Warren asked both men the same questions. McCain said he did not see or hear Obama's session, which might have given him an advantage.
Obama said America's greatest moral failure is its insufficient help to the disadvantaged. He noted that the Bible quotes Jesus as saying "whatever you do for the least of my brothers, you do for me." He said the maxim should apply to victims of poverty, sexism and racism.
McCain said the nation's greatest moral shortcoming is its failure to "devote ourselves to causes greater than our self-interests."
After the September 2001 terrorist attacks, McCain said, there should have been a national push for joining the Peace Corps and other volunteer organizations. His comment seemed an indirect criticism of President Bush, who had urged tax cuts and more shopping to stimulate the economy at the time.
He also said he would pursue Osama bin Laden "to the gates of Hell," another goal that might be seen as a swipe at Bush's administration.
Both men said marriage is a union between a man and a woman. Obama added that he supports civil unions for gay partners, giving them rights such as hospital visits with one another.
In several cases, Obama gave a Christian interpretation to his generally liberal political views. He showed some familiarity with the Scripture, and said Jesus died for his sins.
McCain tended to give shorter, less complex answers. On domestic matters, he restated his call to "drill now" in U.S. lands and waters for oil and natural gas.
When Warren asked Obama to define the word "rich," the Illinois senator teased him about the mammoth sales of his book, "The Purpose Driven Life." He noted his plan to add a Social Security payroll tax to incomes above $250,000 a year.
McCain said, "some of the richest people I've ever known in my life are the most unhappy."
He said being rich should be defined by having a home and a prosperous and safe world. Without mentioning Obama, he said some want to increase taxes.
"I don't want to take any money from the rich. I want everybody to get rich," McCain said. "I don't want to raise anybody's taxes. I really don't."
When pushed on an exact number, he turned to his humor. "If you're just talking about income, how about five million?" he joked, before pivoting to clarify: "I'm sure that comment will be distorted."
Asked to name three wise people they would listen to, Obama named his wife, Michelle; his maternal grandmother, who lives in Hawaii; and, not limiting himself to only a third, named several Democratic and Republican lawmakers.
McCain named Gen. David Petreaus, head of U.S. troops in Iraq; U.S. Rep. and veteran civil rights leader John Lewis, D-Ga.; and former eBay CEO Meg Whitman, a top adviser to his campaign.
He lauded her as a woman who took a five-person business into a billion-dollar piece of the economy. "It's one of these great economic success stories," McCain said.
Obama, asked his most significant policy shift in the last 10 years, cited welfare reform. As an Illinois state senator, he worked to mitigate what he thought could be "disastrous" effects of President Clinton's welfare reform effort, but over time came to embrace Clinton's approach.
"We have to have work as a centerpiece of any social policy," Obama said.
The forum carried opportunities and risks for both candidates. It gave Obama a chance to discuss his Christian faith and counter inaccurate beliefs that he is a Muslim. But it also may have highlighted his positions on issues such as supporting abortion rights, which Warren and many other evangelicals oppose.
McCain's positions are more in line with evangelical Christians. But he often seems uncomfortable talking about his faith and other personal beliefs, and the Christian right shows less enthusiasm for him than for past GOP contenders.
According to Saddleback Church officials, there are 2,200 people in the main room and a total of 4,200 including those watching from satellite locations.