During the tense encounter in Florida, the rivals tangled over the Arab Spring, Iran, Israel and China.
Mr Obama said his rival was "all over the map" on foreign policy. But Mr Romney said the president had allowed "chaos" to engulf the Middle East.
Two instant polls said Mr Obama won the head to head.
The Democratic president went on the attack from the start of Monday night's forum, trying to trip up his rival.
But analysts say Mr Obama did not land any knockout blows on Mr Romney, who has been gathering momentum with two weeks to go until election day, in a race that is now neck and neck.
The debate at Lynn University in Boca Raton, which was moderated by veteran CBS News presenter Bob Schieffer, was not as fractious as their second encounter last week, when Mr Obama came out fighting after his lethargic performance in their first meeting.
But there were several scathing exchanges, with the president seeking to portray his challenger as a foreign policy novice who lacked the consistency to be commander-in-chief.
Mr Obama said the former Massachusetts governor had backed a continued troop presence in Iraq, opposed nuclear treaties with Russia and flip-flopped over when the US should leave Afghanistan.
"What we need to do with respect to the Middle East is strong, steady leadership, not wrong and reckless leadership that is all over the map," said Mr Obama.
But Mr Romney charged that the president had allowed a "rising tide of chaos" to sweep the Middle East, giving al-Qaeda the chance to take advantage.
"I congratulate him on taking out Osama Bin Laden and taking on the leadership of al-Qaeda," said Mr Romney, "but we can't kill our way out of this. We must have a comprehensive strategy."
Mr Obama hit back sarcastically that he was glad Mr Romney had recognised the threat posed by al-Qaeda, reminding him that he had previously cast Russia as the number one geopolitical foe of the US.
"I know you haven't been in a position to actually execute foreign policy," said Mr Obama, "but every time you've offered an opinion you've been wrong."
Mr Romney, whose tone during the debate was measured, described a trip by President Obama to the Middle East as an "apology tour" that had projected American "weakness" to enemies, while bypassing close ally Israel. Mr Obama called that claim the "biggest whopper" of the campaign.
Mr Romney also said: "We're four years closer to a nuclear Iran", although he appeared to soften the uncompromising tone that has been the hallmark of his campaign by emphasising that military action should be a last resort.
'Fewer horses and bayonets'
The rivals found plenty to agree on - declaring unequivocal support for Israel, voicing opposition to US military intervention in Syria, and insisting that China play by the rules in trade.
Mr Romney also backed the president's policy of withdrawing from Afghanistan by 2014 - something the Republican has previously disagreed with.
Mr Romney barely touched on last month's deadly assault on the US consulate. The Republican's line of attack on that subject in the last debate was widely perceived to have misfired.
In one of the most biting exchanges, Mr Obama mocked Mr Romney's complaint that the US had fewer ships now than it did during World War I.
"You mentioned the Navy, for example," said Mr Obama, "and that we have fewer ships than we did in 1916. Well, governor, we also have fewer horses and bayonets than we did in 1916."
Although the debate was meant to focus on foreign policy, the two candidates repeatedly pivoted back to the fragile US economy, the issue uppermost in American voters' minds.
A CBS News snap poll declared 53% believed Mr Obama won, versus 23% for Mr Romney and 24% saying it was a draw. A CNN poll put Mr Obama as the winner by 48% to 40%.
An NBC poll the day before the debate had put the men in a dead heat, each with 47% support.
The final debate behind them, both men will now launch a final two weeks of campaigning in swing states.
Already four million ballots have been cast in early voting in more than two dozen states.