The killing of two dozen unarmed Coptic Christians — and the wounding of hundreds of others — by Egyptian security forces and Muslim extremists in Cairo this week has thrown a dark shadow over the country's prospects for a peaceful transition to democracy. The elation following the popular uprising that drove former President Hosni Mubarak from power last winter has gradually given way to disillusionment and distrust of the military generals running the country, who seem in no hurry to turn over power to an elected civilian government. This week's bloody turmoil deepened that unease by showing just how difficult it will be for Egypt and other nations that have recently thrown off decades of tyranny to fulfill the promises of the Arab Spring.

The deadly confrontation occurred after several thousand members of the Coptic sect, which makes up about 10 percent of Egypt's population, engaged in a peaceful march through the capital to protest the military government's failure to protect their churches. At some point, the demonstrators were set upon by thugs wielding sticks and stones, and as they struggled to defend themselves, army units arrived on the scene. But instead of protecting the protesters, the soldiers opened fire on the crowd, killing at least 17. Other demonstrators were crushed to death under armored vehicles that ran over them.

The brutality of the assault, the most serious outbreak of violence in the capital since the fall of Mr. Mubarak, shocked those who once regarded the Egyptian army as the guarantor of the country's democratic aspirations — a belief that stemmed in no small part from the military's refusal last winter to attack the crowds gathered in Cairo's Tahrir Square demanding an end to autocratic rule. Many Egyptians at the time praised the army as heroes of the revolution.

Since then, however, the generals have shown themselves to be at best reluctant stewards of democracy. Meanwhile, they have mismanaged the economy and allowed the country's once-thriving tourist trade to collapse. They have been willing to trample the very rights to peaceful assembly and freedom of speech the demonstrators thought they had won with the fall of the Mubarak regime, and they have repeatedly pushed back the timetable for elections. Now, this week's vicious killings show they're not averse to exploiting sectarian tensions as well in order to justify maintaining their grip on power.

These developments represent a potentially disastrous turn of events in Egypt's unfolding revolution, and not just for the country's own fledgling democracy movement. Every nation in the region has long-standing religious, sectarian and ethnic divides that must be bridged if democracy is to take hold, and all of them are vulnerable to violent strife in the political vacuum left when strongmen are deposed. If Egypt, long a leader in the Arab world, can't manage to overcome such differences, it surely does not bode well for all the other countries hoping to trade autocracy for democratic rule.