In one pointed confrontation on foreign policy, Obama bluntly challenged McCain's steadiness. "This is a guy who sang bomb, bomb, bomb Iran, who called for the annihilation of North Korea - that I don't think is an example of speaking softly."
That came after McCain accused him of foolishly threatening to invade Pakistan and said, "I'm not going to telegraph my punches, which is what Sen. Obama did."
The debate was the second of three between the two major party rivals, and the only one to feature a format in which voters seated a few feet away posed questions to the candidates.
They were polite, but the strain of the campaign showed. At one point, McCain referred to Obama as "that one," rather than speaking his name.
"It's good to be with you at a town hall meeting," McCain also jabbed at his rival, who has spurned the Republican's calls for numerous such joint appearances across the fall campaign.
They debated on a stage at Belmont University four weeks before Election Day in a race that has lately favored Obama, both in national polls and in surveys in pivotal battleground states.
Not surprisingly, many of the questions dealt with an economy in trouble.
Obama said the current crisis was the "final verdict on the failed economic policies of the last eight years" that President Bush pursued and were "supported by Sen. McCain."
He contended that Bush, McCain and others had favored deregulation of the financial industry, predicting that would "let markets run wild and prosperity would rain down on all of us. It didn't happen."
McCain's pledge to have the government help individual homeowners avoid foreclosure went beyond the details of the bailout that recently cleared Congress. The legislation allows but does not require Treasury to purchase mortgages directly. Obama has said previously that idea should be studied, and his campaign contended McCain's proposal was not a new one.
McCain's campaign issued a written statement that said the $300 billion cost of his initiative would be paid out of the $700 billion approved late last week.
"I would order the secretary of the Treasury to immediately buy up the bad home loan mortgages in America and renegotiate at the new value of those homes, at the diminished value of those homes, and let people be able to make those payments and stay in their homes," he said.
"Is it expensive? Yes. But we all know, my friends, until we stabilize home values in America, we're never going to start turning around and creating jobs and fixing our economy, and we've got to give some trust and confidence back to America."
McCain also said it was important to reform the giant benefit programs such as Medicare, Medicaid and Social Security.
"My friends, we are not going to be able to provide the same benefit for present-day workers that present-day retirees have today," he said, although he did not elaborate.
The two men also competed to demonstrate their qualifications as reformers at a time voters are clamoring for change.
McCain accused Obama of being the Senate's second-highest recipient of donations from individuals at Fannie Mae and Freddie Mac, the two now-disgraced mortgage industry giants.
"There were some of us who stood up against it," McCain said of the lead-up to the financial crisis. "There were others who took a hike."
Obama shot back that McCain's campaign manager, Rick Davis, has a stake in a Washington lobbying firm that received thousands of dollars a month from Freddie Mac until recently.
Pivoting quickly to show his concern with members of the audience listening from a few feet away, he said, "You're not interested in politicians pointing fingers. What you're interested in is trying to figure out, how is this going to impact you."
But that didn't stop the two men from criticizing one another repeatedly as the topics turned to energy, spending, taxes and health care.
Obama said McCain was going to require taxes on the health benefits workers receive from their employers at the same time his plan would wipe out the ability of states to enforce their own regulations to require tests such as mammograms.
McCain countered that under his rival's plan "Sen. Obama will fine you" if parents fail to obtain coverage for their children but had yet to say what the fine would be. "Perhaps we will find that out tonight," he said.
Obama quickly followed up, saying that McCain "voted against the expansion" of the children's health care program the government runs.
The two men prefer dramatically different approaches to easing the problem of millions of uninsured Americans. McCain favors a $5,000 tax credit that he says would allow families to find and afford health care on their own.
Obama wants to build on the current system, in which millions receive coverage through the workplace, with government funding to help uninsured families obtain coverage.
Obama also said that American International Group Inc., which was bailed out by the government, should give the Treasury $440,000 to cover the costs of a company retreat at a posh California resort less than a week after the federal intervention. "Those executives should be fired," he said, referring to the participants in the retreat.
The debate also veered into foreign policy, and the disputes were as intense as on the economy and domestic matters.
McCain said his rival "was wrong about Iraq and the surge. He was wrong about Russia when they committed aggression against Georgia. And in his short career he does not understand our national security challenges. We don't have time for on the job training."
Obama countered with a trace of sarcasm that he didn't understand some things - like how the United States could face the challenge in does in Afghanistan after spending years and hundreds of billions of dollars in Iraq.
The audience was selected by Gallup, the polling organization, and was split three ways among voters leaning toward McCain, those leaning toward Obama and those undecided.
Tom Brokaw of NBC, the moderator, screened their questions and also chose others that had been submitted online.