Obama said: "This is a final verdict on the failed economic policies of the last eight years that said we should strip away regulation - it has not worked out that way.
"Now we [have] got to take some decisive action."
The Illinois senator said his first step would be to ensure that the $700bn taxpayer bailout of beleaguered US banks worked properly and had strong oversight.
He said it was important to take a tough line against the chief executive officers of big banks and companies, to ensure that they would not receive any "golden parachute" payoffs.
He said the US middle class needed a rescue package which helps state and local government and which includes tax breaks, and said that the healthcare and energy systems "needed fixing".
"You need someone working for you - someone thinking about the middle class and not just those who can afford to hire lobbyists," he told the audience in the televised debate.
McCain responded by saying he favoured tax cuts to help the economy.
He said: "For many of you, wages and incomes have declined ... I want to provide a middle class tax cut.
"This problem is so severe that we are going to have to do something about home values [house prices].
"Until we stabilise home values, we will never start being able to turn around and start creating jobs.
"We will get our economy going again and our best days are ahead of us," he said.
Asked how each candidate would tackle climate change, McCain said nuclear power was "safe and clean" and would "create thousands of jobs".
Obama said the issue "was one of the biggest challenges of our times" but that it was also an "opportunity to create a new economy".
He said that although he favoured an expansion in oil drilling and exploration, he said the US could not "simply drill our way out of the problem".
He said that he favoured investment in "solar, wind and geothermal power" and other renewable energy source, as well as nuclear power.
On foreign policy, both candidates were asked to describe their doctrine on intervention. Obama said the US must "work with partners" while McCain said any action would depend on the situation.
McCain said: "I am convinced my record - my judgment - is something I an willing to stand for. Obama was wrong about Iraq and the surge, wrong on Russia.
"We do not have time for on the job training, my friend."
Obama countered: "I do not understand why we invaded a country that had nothing to do with 9/11 - that was McCain's judgment and it was the wrong judgment.
Asked by one audience member whether they would militarily support Israel without UN approval if it was attacked by Iran, McCain said Iran was "a threat to the stability of the entire Middle East".
He said: "If we put enough pressure on the Iranians [with sanctions] ... we can do that ... we can bridge their behaviour.
"We can never allow a second holocaust to take place."
Obama said: "We cannot allow Iran to get a nuclear weapon.
He said the US should use sanctions against Iran, with the warning "if you do not change your behaviour there will be dire consequences".
|Iraq remained a key issue in the
second debate [Reuters]
Rob Reynolds, Al Jazeera's senior Washington correspondent, said: "I think that both men were themselves in this setting.
"McCain stuck to the way he has been campaigning - testy, and more on the offensive than Obama.
"Obama played it cool, very much not rising to McCain's attacks, but he got in some sharp jabs of his own on the economy and Iraq.
"I was struck by the question [to both candidates] - 'why should we trust you?' - an almost bitter tone from the voters assembled here."
Christopher Hayes, the Washington editor of The Nation news magazine, told Al Jazeera: "I thought on the economy McCain looks lost, does not seem comfortable and is not specific.
"The problem is the economy and this is rebounding to Obama's benefit."
A poll conducted by the CBS news corporation shortly after the debate showed 39 per cent of 400 uncommitted voters surveyed said Obama had won the debate while 27 per cent said John McCain was the victor. A total of 35 per cent saw the debate as a draw.
But both candidates' campaign teams issued statements immediately afterwards to proclaim their man as the winner.
McCain entered the debate under pressure to halt his Democratic rival's momentum in the White House race.
Obama has entrenched his national lead in many polls and gained an edge in crucial battleground states as voters turn to the Democrats amid turmoil on the global financial markets.
New polls show Obama holding a clear lead over his rival, with one from CNN showing him with 53 per cent of the vote compared to 45 per cent for McCain.
Tuesday's debate was held in a more informal venue - a favourite setting for McCain and one he used in the party primaries this year and in 2000.