Senators Barack Obama and John McCain in their first presidential debate
US presidential rivals Republican John McCain and Democrat Barack Obama have attacked each other over foreign policy and the economy, in their first debate.
Mr Obama said a $700bn (£380bn) plan to rescue the US economy was the "final verdict" on years of Republican rule.
He said Mr McCain had been "wrong" on Iraq and tried to link him to President Bush. The Republican senator described his rival as too inexperienced to lead.
Neither landed a knockout blow but polls suggested Mr Obama did better.
An immediate telephone poll by CNN and Opinion Research Corp found 51% said Mr Obama had won, to 38% for Mr McCain.
A poll of uncommitted voters by CBS News found that 39% gave Mr Obama victory, 25% thought John McCain had won, and 36% thought it was a draw.
Both campaigns claimed victory, with Mr McCain's team saying their candidate had shown a "mastery on national security issues" while Mr Obama's aides said he had passed the commander-in-chief test "with flying colours".
Tens of millions of Americans were expected to watch the debate on TV, with only about five weeks to go before the 4 November elections.
Senator McCain said he did not need "any on-the-job training".
"I'm ready to go at it right now," he added.
But Senator Obama said Mr McCain had been "wrong" about invading Iraq and that the war had led the US to take its eye off the ball in Afghanistan, where it should have been pursuing al-Qaeda.
Mr McCain argued that as a result of the "surge" - which involved sending some 30,000 extra US troops to Iraq - US military strategy was succeeding.
"We are winning in Iraq and we will come home with victory and with honour," he said.
The televised debate in Oxford, Mississippi, focused largely on foreign policy but began with discussion of the economic crisis gripping the US.
Speaking about the financial bail-out plan under discussion by the US Congress, Mr Obama said: "We have to move swiftly and we have to move wisely."
2 Oct - vice-presidential rivals. Topic: Domestic and foreign policy
7 Oct - presidential contenders. Topic: Any issues raised by members of the audience
15 Oct - presidential contenders. Topic: Domestic and economic policy
The BBC has full and extensive coverage of the debates
Mr McCain said he believed it would be a long time before the situation was resolved.
"This isn't the beginning of the end of this crisis," he said. "This is the end of the beginning if we come out with a package that will keep these institutions stable and we've got a lot of work to do."
Mr McCain attacked Mr Obama over his record on finance, saying he had asked for millions of dollars in so-called "earmarks" - money for pet projects - as an Illinois senator.
The Republican also suggested a spending freeze in many areas apart from defence, but Mr Obama likened the proposal to using a hatchet when a scalpel was needed.
Both candidates agreed that the bail-out plan would put massive pressure on the budget of the next president and mean cuts in government spending.
Asked about Iran, Mr McCain stressed that Tehran was a threat to the region and, through its interference in Iraq, to US troops deployed there.
John McCain and Barack Obama on dealing with Iran
He outlined a proposal for a "league of democracies" to push through painful sanctions against Tehran that were presently being blocked in bodies like the United Nations because of opposition from Russia.
He criticised Mr Obama for his previously stated willingness to hold talks with the leaders of Iran without preconditions.
Mr Obama rejected that criticism, saying he would reserve the right as president "to meet with anybody at a time and place of my choosing if I think it's going to keep America safe".
However, he said he agreed with his Republican rival that "we cannot tolerate a nuclear Iran" and the threat that that would pose to Israel, a staunch US ally.
Mr McCain accused Mr Obama of "a little bit of naivete" in his initial response to the conflict between Georgia and Russia.
"Russia has now become a nation fuelled by petro-dollars that has basically become a KGB [former secret services name] apparatchik-run government. I looked in [Russian Prime Minister Vladimir] Mr Putin's eyes and I saw three letters - a K, a G and B," McCain said.
Speaking about the so-called war on terror, Mr McCain said he believed the nation was safer than it had been the day after the 11 September 2001 terror attacks but there was still a long way to go.
Mr Obama pointed to the spread of al-Qaeda to some 60 countries and said that the US had to do more to combat that, including improving its own image as a "beacon of light" on rights.
"One of the things I intend to do as president is restore America's standing in the world," Mr Obama said.
Mr McCain sought to distance himself from President George W Bush's administration, which has very low public approval ratings.
"I have opposed the president on spending, on climate change, on torture of prisoners, on Guantanamo Bay, on the way that the Iraq war was conducted," he said.
"I have a long record and the American people know me very well... a maverick of the Senate."
Mr McCain had earlier vowed not to attend the forum in Mississippi until Congress approved the economic bail-out plan, but he reversed his decision after some progress was made towards a deal.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.