BOCA RATON, Fla. - A forceful President Obama accused Republican Mitt Romney on Monday of taking a muddled approach to foreign policy that would only encourage the nation's enemies in a dangerous world.

Romney parried by arguing that Obama has failed to address the threats from a Middle East in upheaval, with an Islamist regime in Egypt and a Syria convulsed in civil war, and had "wasted" four years while Iran moved closer to having a nuclear weapon.

American needs "strong steady leadership, not wrong and reckless leadership that's all over the map," Obama said.

Romney countered, "Attacking me is not an agenda . . . is not talking about how we're going to deal with the challenges that exist in the Middle East."

The two men started tangling from the opening moments of their third and final presidential debate, a 90-minute session devoted to national security and foreign policy held here on a stage at Lynn University.

Romney used the opportunity to counter the "warmonger" label that Democrats have applied to him, stressing over and over that he would seek to avoid war as president and that military action would be a last resort. "We can't kill our way out of this mess," he said, speaking of the rise of militants in the Middle East.

As a result, though, he did not provide a sharp contrast to the president on foreign policy issues. Obama jibed at one point that, on issue after issue, Romney supported what the administration is already doing, but just wants to say things "louder."

Both men tried to pivot the foreign-policy discussion back toward domestic concerns, with Romney contending Obama's failures to revive the economy had hurt America's standing abroad. Obama put Romney on the defensive by bringing up the Republican's past opposition to auto industry bailouts.

"I'm a son of Detroit. I was born in Detroit. My dad was head of a car company," he said. "And I would do nothing to hurt the U.S. auto industry."

Romney entered the encounter riding a surge that began after he demolished Obama in their first debate three weeks ago. In the best stretch of his campaign, Romney has pulled into a tie with the president in national and swing-state polls.

Obama advisers have long considered the president's successes abroad, from pulling troops out of Iraq, to killing Osama bin Laden and winding down the conflict in Afghanistan, to be an advantage on foreign policy in his reelection campaign.

A Quinnipiac University/CBS poll of voters in Ohio released Monday gave Obama a 7-point advantage on handling foreign policy matters. Yet on the question of who is the stronger leader, the same survey gave Romney the edge.

Obama pressed that foreign-policy advantage, accusing Romney of "airbrushing history" to simply ignore previous positions he had taken, such as wanting to maintain a large troop presence in Iraq. Romney also had criticized the president's plan to withdraw U.S. forces from Afghanistan by 2014, but on Monday supported it.

On some foreign issues, Romney's positions differ from the president's more in tone than in their particulars. For instance, on the continuing dispute with Iran over its efforts to build a nuclear-weapons program, Romney has said Obama has not spoken forcefully enough, but he also supports the economic sanctions the administration has imposed along with the international community.

Romney also focused on the stalemate between Israel and the Palestinians, and, though he accuses Obama of not being solicitous enough of Israel's leaders, he has not jettisoned the two-state approach to the conflict that has been U.S. policy for decades.

Romney also bored in on growing economic and security tensions with Russia and China.

For his part, Obama tried to convince viewers that his opponent does not have the capacity to lead in a world filled with shades of gray. He and his surrogates have attempted to undercut Romney by pointing out that many of his foreign-policy advisers are neoconservatives responsible for the Iraq war and other go-it-alone approaches in the administration of George W. Bush.

Noting that Romney had said in an interview earlier this year that Russia was the greatest future geopolitical threat to the United States, Obama scoffed. "The 1980s, they're now calling to ask for their foreign policy back," he said.

Obama was aggressive in attacking Romney for proposing an increase of $2 trillion in defense spending, without a specific strategy.

"You mentioned the Navy, for example, and that we have fewer ships than we did in 1916," the president said. "Well, governor, we also have fewer horses and bayonets - because the nature of our military's changed. We have these things called aircraft carriers where planes land on them. We have these ships that go underwater, nuclear submarines."

In responses to a question from moderator Bob Schieffer, Obama said he considered terrorist networks the greatest threat to national security.

Romney said the greatest threat was a nuclear Iran, but he also jabbed Obama for telling the Russian president at a conference that he could give more "flexibility" on domestic issues after the election. "They'll get more backbone after the election," Romney said, after he wins.

Obama's campaign hit that theme hard in a television ad released earlier in the day. It claims that Romney would have left U.S. troops in Iraq and opposes winding down the war in Afghanistan.

"President Obama ended the Iraq war. Mitt Romney would have left 30,000 troops there and called bringing them home 'tragic,' " the ad says. "It's time to stop fighting over there and start rebuilding over here."

One political scientist, Michael Federici at Mercyhurst University in Erie, called the evening a draw.

"To me the most striking thing about the debate was that Romney felt comfortable enough with where he is in the race to play it safe," Federici said, "and Obama felt the need to aggressively attack Romney, an indication that he has been advised to step up his game."