US President George W Bush and his Democratic challenger John Kerry have clashed in a TV debate on how to handle the war in Iraq and homeland security.
Millions watched the two men joust for votes
Mr Kerry called the conflict a diversion in the broader struggle
Mr Bush said he was confident of poll victory because he had shown the American people he knew how to lead.
The two men were taking part in the first of three televised debates in the run-up to November's election.
At times, the president seemed uncomfortable at the criticism, but was soon in his stride, says the BBC's Rob Watson in Miami where the debate was held.
There were several sharp exchanges, Senator Kerry at one point saying the president's certainty about issues did not make him right, but neither man appeared to deliver a knock-out blow, our correspondent says.
They are set to meet in another two debates before the election itself on 2 November.
As expected, Mr Kerry made Iraq the focus of his challenge against the president, saying the war in Iraq had been a diversion that had no links with the 11 September attacks and was a "colossal error of judgement".
'I know how to lead'
"I believe in being strong and resolute and determined. And I will hunt down and kill the terrorists, wherever they are. But we also have to be smart. And smart means not diverting your attention from the real war on terror in Afghanistan against Osama Bin Laden," he said.
Mr Bush rejected Mr Kerry's accusation that invading Iraq had been the wrong priority, arguing that he had to deal with both Osama Bin Laden and Saddam Hussein.
On the election, he said: "I believe I'm going to win, because the American people
know I know how to lead... I understand everybody in this
country doesn't agree with the decisions I've made. And I
made some tough decisions. But people know where I stand."
He accused Senator Kerry of denigrating the contribution of America's existing allies in Iraq like Britain and Poland, and said the US would not be able to marshal effective international support under a leader who viewed the Iraqi war as a mistake.
Mr Kerry said Mr Bush had left the US bearing 90% of the casualties and 90% of the costs.
He went on to say that a more considered policy in Iraq could change the dynamics on the ground and allow the US to start withdrawing troops in six months.
Towards the end of the debate, the two men discussed the situation in the troubled Sudanese region of Darfur, both saying it should be considered genocide.
They also agreed nuclear proliferation was the greatest threat facing the US.
Mr Kerry said the main danger was the risk of nuclear material from the former Soviet Union falling into terrorist hands.
He said the president's failure to engage with North Korea had created conditions which had allowed Pyongyang to press ahead with its nuclear ambitions.
President Bush said his administration was acting firmly to deal with nuclear proliferation. He argued that the current multilateral talks were more likely to yield results than bilateral talks with North Korea.
Millions watched the debate which took place at the University of Miami in Coral Gables, Florida.
The moderator in Thursday's debate was broadcaster Jim Lehrer, who has presided over nine such sessions in the last four presidential elections.
Mr Kerry and Mr Bush will take part in a second debate in Missouri, on 8 October, in a town-hall-style meeting where they will take questions from the audience.
The final debate is set for 13 October in Arizona, and will focus on domestic issues.
Vice-President Dick Cheney and Mr Kerry's running mate, John Edwards, will hold a single debate in Ohio on 5 October.
Most computers will open PDF documents automatically, but you may need to download Adobe Acrobat Reader.