By Matt Spetalnick
WASHINGTON (Reuters) - In the defining moment of a testy debate, President Barack Obama lashed into Mitt Romney on Tuesday over the Republican's criticism of his handling of a deadly attack on the U.S. diplomatic mission in Libya and sought to cast him as unfit to become commander-in-chief.
Moving to regain lost ground after a weak performance in the first presidential debate, Obama fought back against his rival's accusations that he had played down the September 11 assault by Islamist militants in Benghazi that killed the U.S. ambassador and three other Americans.
Romney, who dominated the candidates' previous encounter, appeared stunned as Obama launched a finger-wagging counterattack over an issue that has become a flashpoint with just three weeks to go in a presidential race considered too close to call.
The exchange came near the end of a debate dominated mostly by arguments over the economy, jobs and taxes, considered voters' main concerns in the November 6 election.
Romney and his aides have sought to use the Benghazi incident - as well as anti-American unrest in other parts of the Arab world - to dent Obama's national security credentials and accuse him of pursuing a failed Middle East policy.
But Obama came out swinging in their second debate at Hofstra University in Hempstead, New York, accusing Romney of exploiting the Benghazi attack in an effort to score "offensive" political points.
"While we were still dealing with our diplomats being threatened, Governor Romney put out a press release, trying to make political points, and that's not how a commander-in-chief operates" Obama said, referring to the Republican's initial criticism of the administration's response before the full extent of the bloodshed was known.
Obama and Romney argued testily in front of a group of undecided voters over whether Obama had come out fast enough in describing the Libya attack as terrorism, and the president appeared to get the better of his opponent.
"I stood in the Rose Garden and I told the American people and the world that we are going to find out exactly what happened, that this was an act of terror," Obama said.
Romney was incredulous. He challenged Obama's assertion, apparently unaware of Obama's remarks the morning after the Benghazi attack.
"Get the transcript," Obama told Romney in the closest thing to a smack-down moment in the 90-minute debate.
"He did, in fact, sir," moderator Candy Crowley said, siding with Obama. "He did call it an act of terror."
A transcript of the Rose Garden appearance that day shows Obama said: "...no acts of terror will ever shake the resolve of this great nation."
But despite that comment, some of Obama's top aides had initially attributed the Benghazi violence to protests over an anti-Islam film and said it was not premeditated, before finally acknowledging much later that it was a terrorist attack.
And Obama, in a September 24 taping of an appearance on ABC's "The View" program, also seemed to hedge when he was asked whether Benghazi was an act of terrorism. He said it "wasn't just a mob action" but pointed to an ongoing investigation.
Obama said for the first time on Tuesday he was "ultimately responsible" for the safety and security of the Americans killed in the attack. "I'm the president and I'm always responsible," he said.
Seeking to recover from his apparent misstep, Romney pointed to the administration's shifting explanations of the events in Benghazi, suggesting it had been an attempt to mislead.
"It took them a long time to say this was a terrorist act by a terrorist group," he said.
In the months before the deadly attack in Benghazi, Libya, U.S. and allied intelligence agencies warned the White House and State Department repeatedly that the region was becoming an increasingly dangerous vortex for jihadist groups loosely linked or sympathetic to al Qaeda, according to U.S. officials.
Despite those warnings and bold public displays by Islamist militants around Benghazi, embassies in the region were advised to project a sense of calm and normalcy in the run-up to the anniversary of the September 11 attacks in the United States.
Romney's supporters have accused the administration of being slow to label the attack as terrorism to avoid detracting from the president's campaign narrative of being a strong world leader who put al Qaeda on the path to defeat.
Polls have shown national security a strong point for Obama with voters, especially after the killing of Osama bin Laden.
Going on the offensive, Obama sought to depict Romney, who has little foreign policy experience and has stumbled during his occasional forays on the world stage, as ill-prepared to take on the role of commander-in-chief in a dangerous world.
Romney fired back, saying the Benghazi incident "calls into question the president's whole policy in the Middle East."
"Look what's happening in Syria, in Egypt, now in Libya. Consider the distance between ourselves and Israel," Romney said. "We have Iran four years closer to a nuclear bomb."
(Reporting By Matt Spetalnick; Editing by Alistair Bell and Eric Walsh)