WASHINGTON—For months, the U.S. saw Egyptian President Mohammed Morsi as a viable partner. While officials pushed him behind the scenes to make political changes, they were muted in their public criticism. That changed suddenly this week after protests swelled, when in a series of public comments Obama administration officials appeared to give the green light for the military to take action.

This back-and-forth echoes the Egyptian revolution of 2011, during which the White House maintained its support for longtime ally and...