The debate presented a huge opportunity for the candidates to deliver their message to millions of Americans - or make an embarrassing blunder.
Interest in Friday's debate was amplified by suspense about whether it would even take place. McCain had said he wouldn't take part unless the financial crisis was resolved, then reversed course and decided at the last minute to participate without a deal.
McCain, 72, frequently referred to his age and experience.
Sometimes he joked - at one point he waggled his eyebrows and quipped that the moderator didn't think he could hear the question - and other times he went out of his way to mention the foreign countries he has visited and the years he has spent on Capitol Hill.
"I have a long record and the American people know me very well," he said.
But Obama, a 47-year-old serving his first term in the Senate, challenged McCain frequently and offered himself as someone who can be trusted to make sound choices.
Obama noted that he opposed invading Ira‡condition.
"This is dangerous. It isn't just naive; it's dangerous," McCain said.
The two bickered at times, talking over one another and throwing accusations of twisted words and false statements. But Obama sometimes acknowledged agreements with McCain - concessions that might reinforce Obama's claim to be a politician who can find common ground and reduce confrontation in Washington.
The stakes were high as the two rivals walked on stage. The polls gave Obama a modest lead and indicated he was viewed more favorably than his rival when it came to dealing with the economy.
But the same surveys show McCain favored by far on foreign policy.
The candidates stood behind identical wooden lecterns on stage at the performing arts center at the University of Mississippi for the first of three scheduled debates with less than six weeks remaining until Election Day. The two vice presidential candidates will meet next week for their only debate, and Obama and McCain each put in a plug for his own running mate.
But there was a difference: Democrat Joe Biden made the round of post-debate television shows. NBC and CNN said they invited McCain's running mate, Alaska Gov. Sarah Palin, who has granted only three interviews since joining the ticket a month ago, but she declined.
Moderator Jim Lehrer's opening question concerned the economic crisis. While neither man committed to supporting bailout legislation taking shape in Congress, they readily agreed lawmakers must take action to prevent millions of Americans from losing their jobs and their homes.
Both also said they were pleased that lawmakers in both parties were negotiating on a compromise.
Neither could offer specifics about how the potential $700 billion price tag of a Wall Street bailout might affect their ability to implement all the campaign promises they've made.
McCain jabbed at Obama, who he said has requested millions of dollars in pork barrel spending, including some after he began running for president. As he does frequently, the Republican vowed to veto any lawmaker's pork barrel project that reaches his desk in the White House.
McCain said a freeze on most government spending was worth considering, except for veterans, defense and "some other vital issues."
Obama said the problem with that was that some programs needed more money. He mentioned early childhood education as an example.
"The problem with a spending freeze is you're using a hatchet where you need a scalpel," he said.
The presidential hopefuls are scheduled to debate twice more, at Belmont University in Nashville on Oct. 7 and at Hofstra University in Hempsted, N.Y., on Oct. 15.