Obama's comments were widely seen as a warning to Egypt, which was considered a staunch U.S. ally under Mubarak and remains a major recipient of American foreign aid. It is the most populous and one of the most influential nations in the Arab world.
When the protests began Tuesday, police and Egyptian troops formed defensive lines around the embassy to prevent demonstrators who had also gathered there from advancing, but not before the protesters had scaled the embassy fence and placed a black flag atop a ladder in the American compound.
Police arrested a handful of protesters at the time, but the failure of Egyptian authorities to take action sooner has been widely questioned, as has Morsy's delayed condemnation of the attacks on American diplomatic missions.
Morsy initially focused his criticism on the anti-Muslim film as an unacceptable slap at Islam.
But after speaking with Obama, Morsy on Thursday directly criticized the violence.
"Those who are attacking the embassies do not represent any of us," he said from Brussels, Belgium, where he was visiting the headquarters of the European Union.