The clashes exposed deep divisions in Egypt between supporters and opponents of the military-backed government.