BOCA RATON, Fla. — In their third and final presidential debate, President Obama and Mitt Romney clashed Monday over the direction of American policy in the Middle East and the evolving shape of the country’s leadership role around the world.

The debate focused on foreign policy, and Obama underscored his achievements as commander-in-chief — ending the war in Iraq, drawing down in Afghanistan, and killing Osama bin Laden — to argue that he has been effective and vigilant in the war on terror.

Advertisement - Continue Reading Below

Romney countered that the administration did not show the foresight to predict and manage the tumultuous changes in North Africa and the Middle East since the revolutions of the Arab Spring, or the pro-democracy demonstrations in Iran. Obama began his administration, he charged, by conducting an “apology tour” in the region — an allegation Obama sharply called untrue.

Seated side by side before moderator Bob Schieffer of CBS News, Obama and Romney moved quickly and pointedly on issues confronting countries across the Muslim world — from Libya, to Egypt, to Syria, and Iran — with Obama defending his handling of the insurgencies, and Romney arguing that the United States should work more closely with rebels.

Obama strongly defended his stance toward Iran and the development of its nuclear program. Sanctions have been crippling, he said, while pledging that the country will never develop a nuclear weapon under his administration.

“Al Qaeda’s core leadership has been decimated,” Obama said. And in Libya, he lamented the death of the US ambassador and three other Americans in an assault there last month, but added, “you have tens of thousands of Libyans marching and saying, ‘America is our friend; we stand with them.’ ’’

Romney said the region has become a threat to the nation’s interests. “You see Al Qaeda rushing in; you see jihadists in” to the region, Romney said.

“My strategy is pretty straightforward — to go after the bad guys,” Romney said. “The key is to get the Muslim world to reject extremism on its own.”

Obama criticized Romney’s proposals for additional military spending, saying that the country couldn’t afford it and the military wasn’t asking for it.

“Our military spending has gone up every single year I’ve been president,” Obama said. “We spend more on our military than the next 10 countries combined.”

One of the most pointed lines of the debate came after Romney criticized President Obama for cutbacks in certain areas of the military. Delivering a line he frequently uses on the campaign trail, Romney noted that the Navy is smaller than any time since 1917, and the Air Force at its smallest level since 1947.

Obama said Romney was using an outdated view of how military spending works, and where the needs are.

“We also have fewer horses and bayonets,” Obama said. “It’s not a game of Battleship.”

Both proclaimed that the United States would stand with Israel if the longtime ally is attacked.

But they diverged sharply on the standing of the United States in the world. “In nowhere in the world is America’s influence greater than it was four years ago,” Romney said.

“The world needs a strong America,” Obama said. “And it is stronger now than when I came into office.”

Both reverted to talking about their domestic policy agendas, with Romney going through his five-point economic plan and Obama touting his policies on education.

“Let me get back to foreign policy,” Schieffer said at one point. “I want to try to shift it, because we have heard some of this in previous debates,” he added at another.

The 90-minute debate was the last chance for the candidates to separate themselves in a face-to-face encounter before scores of millions of viewers. In the first debate in Denver three weeks ago, Romney vaulted back into close contention with a strong display that provided a sharp contrast with Obama’s lackluster effort.

In the second debate last week on Long Island, Obama rebounded with an aggressive performance that seemed to slow Romney’s surge in what remains a grinding race where neither man has broken away.

In polling, foreign policy routinely trails domestic issues such as the economy and health care among voter concerns, but Monday’s forum handed each man a chance to project a sense of leadership, which could prove pivotal in helping the small remaining bloc of undecided Americans move toward a candidate.

On Monday, a new Quinnipiac University/CBS News poll found that Obama held a seven-point lead on his handling of foreign policy in the key swing state of Ohio.

Nationally, a Washington Post/ABC News poll released Monday showed Obama leading Romney among likely voters, 49 to 48 percent. The president also had a one-point lead on how he would deal with terrorism, an area where he once enjoyed an 11-point advantage.

Romney has in the past contended that Obama has distanced the United States from Israel and encouraged Iran to continue its development of a nuclear weapon because of the president’s reluctance to draw red lines that Iran could not cross without risking a military strike.

At last week’s debate, Romney also criticized Obama for what he said was faulty intelligence before and after the deadly Sept. 11 attack on the US consulate in Benghazi, Libya, in which the US ambassador and three other Americans died.

Romney said at Hofstra University that the administration took two weeks to label the attack a terrorist assault, although the president quickly countered that he did so the following day.

The most pointed exchange there occurred when the president said Romney had been “offensive” when he suggested that Obama put campaign politics ahead of an investigation into the attack.

Senator John F. Kerry, in the final hours before the debate, harshly criticized Romney as a foreign-policy novice whose presidency would be dangerous for the country.

The Massachusetts Democrat, who has played Romney in mock debates with Obama, called the Republican ticket ”the most inexperienced twosome in modern history to run for president and vice president” and said they “lack of clarity in almost anything they’ve said.”

He also assailed Romney for a willingness to change positions.

“Mitt Romney was against going into Libya, for going into Libya, against it,” Kerry said. “He has been on the wrong side — or another side, or a fourth side, of almost all of these foreign policy issues. So tonight’s the night of reckoning.”

Romney’s campaign fired back, arguing that “America stands weakened around the world, with our safety threatened, our allies increasingly isolated, and hostile nations emboldened.”

Senator John McCain of Arizona, who lost to Obama in 2008, called the president’s foreign policy “an abject failure” while speaking to reporters before the debate.

The Obama campaign also released an ad Monday that contrasted the president’s record on Iraq and Afghanistan with Romney’s stances.

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

The president rehearsed for 45 minutes in the morning before leaving Camp David, Md., to fly to Florida. Later, after a walk-through of the debate hall, Obama left for a Boca Raton hotel, where he spent time with advisers.

Romney spent the morning on final preparations, and the afternoon with his sons.

Romney on Tuesday will leave Florida for campaign events in Henderson, Nev., and Morrison, Colo. On Wednesday, he will speak in Reno, Nev., and Cedar Rapids, Iowa, before spending Thursday in Ohio.

The president will hold rallies Tuesday in Delray Beach and Dayton, Ohio. On Wednesday, a frenetic tour of swing states will take him to Davenport, Iowa; Las Vegas; and Denver, before journeying to Los Angeles to appear on the “Tonight Show.”