WASHINGTON - Barack Obama and John McCain took aim at one another over foreign policy and how they planned to solve the U.S. economic crisis in a critical presidential debate that took place amid a Wall Street financial meltdown that some fear could herald another Great Depression.

Obama was quick to point out that the economic crisis started under President George W. Bush and was promoted by McCain, noting that both men were opposed to regulating the financial industry despite his own warnings to Congress that a day of reckoning was ahead.

"Yes, we've got to solve this problem in the short term and we are going to have to intervene but we have to look at how we shredded so many regulations," he said.

McCain suggested government overspending has contributed to the crisis, accusing Obama of being in favour of raising taxes and voting for millions of dollars of spending.

The Arizona senator even suggested he would consider a spending freeze if elected president, saying money would go only to the military and veteran affairs.

Obama seemed visibly incredulous at McCain's apparent theme of that segment of the debate -- that government overspending had played a role in the current crisis, and was something he intended to put a stop to.

"John, it's been your president over the last eight years who presided over this increase in spending, this orgy of spending ... and you voted for almost all of his budgets," Obama said.

The debate Friday was easily one of the most highly anticipated verbal faceoffs in recent memory.

McCain, sagging in the polls in the face of the economic crisis, had vowed not to attend unless a deal was reached between Congress and the federal government over the proposed US$700 billion bailout of the country's failing banks and financial institutions.

But in a surprise change of tack Friday morning, McCain's campaign said he would, in fact, show up for the debate even though a deal had yet to be reached among legislators in Washington.

Even though Friday's debate was originally supposed to focus on national security and foreign policy, the economy was a major discussion point given it was preoccupying not just politicians in Washington but Americans from every walk of life.

The men also clashed, however, over the war in Iraq, with Obama saying the U.S. had focused on the wrong target and should instead send more troops to Afghanistan, "the central front of terrorism."

McCain, a former U.S. Navy pilot, said the war had brought democracy and order to Iraq, frequently smirking while his rival for the White House spoke and suggested at times he "doesn't understand" military strategy.

"We will prevail in Afghanistan," McCain said. "But if we suffer defeat in Iraq ... that will have a calamitous effect on Afghanistan."

On the issue of Iran acquiring nuclear weapons, McCain said he's proposed a "league of democracies" to impose sanctions on the Iranians that would have a beneficial affect.

Obama said the war in Iraq was partly responsible for Iran's emerging powers since it effectively eliminated the country's biggest enemy.

"The single thing that has strengthened Iran has been the war in Iraq .... and what we've seen in the last couple of years is Iran's influence grow," he said. "So obviously our policy over the last eight years has not worked."

He proposed tough diplomacy with Iran, but McCain scoffed at him for suggesting he'd sit down with hostile foreign leaders with no pre-conditions.

The atmosphere was tense during the debate, with both men visibly agitated at times and interrupting one another -- not surprising given the tight race for the White House that has only just opened up, with Obama enjoying a modest lead over McCain in the polls in the face of the economic crisis.

McCain's extraordinary announcement on Wednesday that he was suspending campaigning to head to Washington to deal with the crisis was viewed as daring political manoeuvring that backfired.

Obama refused to bow to McCain's insistence that the debate needed to be postponed, saying he was heading to Mississippi.

There was no real knockout punch during the first 90 minutes of the debate, with neither man delivering any blows that tripped up his opponent.