The killing of the U.S. ambassador to Libya and three other Americans, in one of the most brazen attacks on a U.S. diplomatic compound in a generation, sparked a security crisis in the North African country, elevated tensions across the Middle East and raised concerns about how well the U.S. can protect its diplomats abroad.

The U.S. responded to the assault by dispatching two Navy destroyers, dozens of Marines, federal investigators and intelligence assets to Libya to protect Americans and help hunt the suspected religious...