The president responded to Romney near the end of a day when even some Republicans with experience in national security matters questioned Romney's handling of the issue, calling it hasty. Top Republican leaders in Congress pointedly declined to endorse his criticism of the president.
It was a rare day in the U.S. campaign when foreign policy took center stage instead of the economy and the unemployment rate of 8.1 percent - long the No. 1 issue for voters.
Recent polls show Obama comfortably leading Romney when it comes to which candidate voters feel is more adept at handling matters of national security. The Republican challenger, a former Massachusetts governor with little international experience, has worked to whittle away at that deficit.
The events unfolded with less than eight weeks remaining in the race for the White House, a campaign that has been close for months. Polls show Obama holding a slim lead in some battleground states, which are crucial because the U.S. president is elected not by popular vote but in state-by-state contests.
Romney, who has a slight advantage in recent surveys when it comes to economic matters, went on the offensive on foreign policy amid the turmoil in the Middle East.
Chris Stevens, U.S. ambassador to Libya, and three other American diplomats were killed on Tuesday as protesters overran and burned the U.S. Consulate in Benghazi. In a separate incident, the American Embassy in Cairo was breached by protesters, and the nation's flag was ripped down, although no deaths were reported there.
U.S. officials are investigating whether the attack in Libya was a terrorist strike planned to mark the 11th anniversary of the attacks of Sept. 11, 2001. Initial reports were that both the Libya and Egypt events had been motivated by anger over an amateur film made in the United States that ridiculed Islam's Prophet Muhammad.
Romney criticized an initial statement from the U.S. Embassy in Cairo as disgraceful and "akin to apology."
He added, "It's never too early for the United States government to condemn attacks on Americans and to defend our values."
Romney's account didn't mesh completely with events in Cairo.
The embassy statement that he referred to as akin to apology was issued by the embassy in Cairo at midday on Tuesday at a time the staff was aware of still-peaceful demonstrations in the area nearby. It was four or five hours later when the mob breached the compound's walls and tried to burn a U.S. flag.
The embassy statement, which came hours before the deaths in Libya, called for calm. It also condemned "the continuing efforts by misguided individuals to hurt the religious feelings of Muslims - as we condemn efforts to offend believers of all religions," and noted that religious freedom is a cornerstone of American democracy.
Romney added that the White House later "distanced itself" from the statement, saying it hadn't been cleared by senior officials in Washington. "That reflects the mixed signals they're sending to the world."
Appearing in Jacksonville, Florida, Romney quickly broadened his remarks to emphasize other disagreements he has with Obama on national security issues, citing "differences of opinion with regards to Israel and our policies there; with regards to Iran, with regards to Afghanistan, with regards to Syria."
Republican vice presidential candidate Paul Ryan, in an interview later in the day, also said the initial statement had come as the embassy was under attack. "I disagree with the original statements that the embassy put out - that the administration put out in Cairo sympathizing with the people who were storming the embassy. We should stand up for our values," he said.
Obama initially chose not to respond to Romney. During an appearance outside the White House, he somberly mourned the deaths and announced the deployment of additional Marines at diplomatic posts overseas in his capacity as commander in chief.
Obama-the-political-candidate later shed his reluctance with an unusually personal criticism of Romney during an interview with CBS television.
"It's important for you to make sure that the statements that you make are backed up by the facts. And that you've thought through the ramifications before you make 'em," Obama said. "It appears that Gov. Romney didn't have his facts right."
"And make no mistake. Justice will be done" he declared, referring to those responsible for the murders of the U.S. ambassador to Libya, and three others.
Some Republicans joined Democrats in questioning Romney's decision to inject himself into the situation thousands of miles (kilometers) away with his critical statement Tuesday night.
Gordon Johndroe, a national security aide during George W. Bush's presidency, said Romney's reaction as a candidate was quicker than he would be able to make if he were president.
"Events happen quickly but the information at first is very vague and uncertain. You don't know who has done the attack, how many people, who was attacked, were people just injured or killed. It takes a while for information to come through, and you have to be very careful and cautious when responding."
Top Republican leaders in Congress did not come to Romney's defense as they - like the Republican challenger and the president - mourned the deaths of the fallen diplomats.
Senate Republican leader Mitch McConnell of Kentucky said Obama "correctly tightened the security overseas." Asked about Romney's remarks, he declined to answer and walked toward his office in the Capitol.
House Speaker John Boehner issued a brief statement condemning the violence against the U.S., as did Majority Leader Eric Cantor of Virginia, but neither included any reference to the president.
Romney, on Wednesday, defended his decision to issue his first critical statement Tuesday night, at a time when it was not yet known that Stevens had been killed. Asked if he would have done so had he been aware of the deaths, he said, "I'm not going to take hypotheticals about what would have been known and so forth."
Romney has received mixed reviews before for his handling of foreign policy matters. During a heavily publicized overseas trip early this summer, he was reproached by British officials when he appeared to question preparations for the Olympic Games in London. He was also criticized for failing to mention the war in Afghanistan during his speech at the Republican national convention last month.
Asked in a Washington Post-ABC News poll last week which candidate was better suited to handle international affairs, registered voters picked Obama by a margin of 51 percent to 38 percent.
Obama has not ceded any territory. Speeches and video presentations at last week's Democratic National Convention were heavily stocked with references to the daring raid the president ordered more than a year ago that resulted in the death of terrorist mastermind Osama bin Laden.
While top Republican leaders in Congress avoided criticism of Obama, other GOP lawmakers were not as reluctant.
Republican Sen. Jim Inhofe noted the timing of the events and said, "America has suffered as a result of President Obama's failure to lead and his failed foreign policy of appeasement and apology."