Demonstrators attacked a U.S. consulate in Libya, killing one American, and breached the walls of the U.S. Embassy in Cairo, amid angry protests over a film by a U.S. producer that mocks and insults the Prophet Muhammad.

The footage, which depicts the Islamic Prophet Muhammad as a womanizing fraud, was posted on YouTube in early July under the user name Sam Bacile.

In...