Is there such a thing as a good coup? It sure can feel like there is, and that feeling – boisterous, ecstatic, flag-waving – coursed through the streets of Cairo late into Wednesday night and well into Thursday morning, snarling traffic, filling the soft night air with the music of car horns, and almost entirely obscuring what history tells us about the events like those that had just unfolded in Egypt: They tend not to end well.

You don’t have to look far, just a bit south and east. In the last days of the millennium, joyous crowds carried uniformed soldiers through the streets of Abidjan after generals took control of the West African nation of Cote d’Ivoire, or Ivory Coast, in what became known as the Christmas Coup because it occurred on Dec. 24, 1999. Foreign diplomats privately approved the removal of a corrupt one-party government. Civil society leaders called it an “opportunity.”

“Of course we condemn any coup, because a coup is not a democratic way to come to power,” a former IMF official named Alassane Outtara told me a couple of weeks later. “But if it’s removing a dictator from power, is that a good thing or a bad thing?”

Outtara was among those who stood to benefit by the change. Removed from the post of prime minister by the president the generals jailed, he intended to run for office when fresh elections were scheduled. But the post-coup constitution disqualified his candidacy, and what followed was ten years of civil war fought on the lines of religion and national identity. When Ouattara finally took office as president, more than ten years later, it was because his electoral victory was enforced by militias supporting his side, who at last cornered his opponent in his villa, where he was famously photographed seated on his bed, the very picture of dejection.

In Cairo on Wednesday night, the generalized feeling was one of triumphant relief, though an elected president had been removed, a recently approved constitution suspended, and a peaceful public demonstration cordoned off and shut down by soldiers in armored personnel carriers. At the sprawling Egyptian Military Academy near Cairo’s airport, cadets stood on the roof facing El-Orouba Road and waved to the parade of honking cars that had slowed to a walking pace, children and flags poking out every open window. A block off the main highway, in a neighborhood where the Muslim Brotherhood was popular, the streets were silent and the apartment blocks dark.

What might happen when an openly Islamist government is elected, but denied power by the military? In Algeria, a couple of thousand miles down the Mediterrean Coast, the Islamic National Front won a national ballot in 1991, prompting the military to cancel the election. A brutal armed insurgency followed, claiming as many as 200,000 lives.

Egypt is not Algeria, of course. The Arab Spring, or Awakening, that ventilated Egypt’s politics and empowered its masses did not reach that far. But in the immediate wake of the coup, there was at least a shadow of apprehension over the future on the streets of Cairo, even on the maze of overpasses that overlook Tahrir Square. Cars were parked all along the freeways there, whole families promenading happily on the 6 October Bridge as it approached the Nile, wide and splendid and throwing back the city’s neon.

At the rail facing south, a student Mohammad Assad stood with two friends, drinking deeply of the night air and the fact that a president they despised was, suddenly, gone. “He’s f—ed forever,” said Assad, 25, with a satisfied smile. “”He and the Brotherhood.”

“Goodbye, Morsi,” said his friend, also named Mohammad.

And the generals? Does he trust them?

Assad kept smiling, but stiffened a bit. “Yes,” he said, “I must.” He paused, and in a moment his expression had made it halfway to a wince. “I must,” he said again.

Karl Vick has been TIME's Jerusalem bureau chief since 2010, covering Israel,the Palestine territories and nearby sovereignties. He worked 16 years at the Washington Post in Nairobi, Istanbul, Baghdad, Los Angeles and Rockville, MD.