President Barack Obama accused Republican candidate Mitt Romney of being consistently wrong on foreign affairs as the two presidential rivals squared off in their third and final debate with the race in a dead heat two weeks before Election Day.
Mr Obama criticised Mr Romney's support for beginning the war in Iraq, for opposing his plans to withdraw troops from Iraq, for inconsistent stances on Afghanistan and for opposing nuclear treaties with Russia. "Every time you've offered an opinion you've been wrong," Mr Obama said.
Mr Romney defended his stances and told Mr Obama that "attacking me is not an agenda" for stopping violence in the Middle East.
The debate on foreign affairs came as international issues have taken a higher profile in a race that has been dominated by economic issues.
Mr Romney and fellow Republicans have criticised the Obama administration's response to a September attack on the US consulate in Benghazi, Libya, that killed the ambassador and three other Americans. But asked about the attack at the outset of the debate, Mr Romney did not directly criticise Mr Obama as sharply as he had in the past, calling for a comprehensive strategy to reduce violence in the region. "We can't kill our way out of this mess," he said.
Foreign policy is generally seen as Mr Obama's strength. He gave the order leading to the killing of terrorist leader Osama bin Laden and fulfilled a promise to withdraw US troops from Iraq. Mr Romney, a former Massachusetts governor and wealthy businessman, has little foreign affairs experience.
But Mr Romney has recently been on the offensive on international issues and has trimmed Mr Obama's advantage in foreign affairs. In addition to the Libya criticism, he has accused Mr Obama of being weak in opposing Iran's nuclear programme, failing to defend US economic interests in relations with China, and not doing enough to support US allies such as Israel.
However, it was Mr Obama who began the debate by criticising Mr Romney. After a lacklustre performance in the first debate, Mr Obama appeared keen to go on the offensive in the latest encounter, just as he had in last week's debate. The debate performances have been judged at least as much by the general impressions of the candidates as by their specific proposals. With polls showing few voters ranking foreign affairs among their top concerns, the candidates were vying to leave the impression that they are strong leaders.
An NBC News/Wall Street Journal poll released on Sunday showed Mr Obama and Mr Romney tied, with both candidates backed by 47% of likely voters nationwide.
The debate was being moderated by veteran newsman Bob Schieffer of CBS News.