Historic Tahrir Square exploded in joy shortly after 9 p.m. Wednesday when, for the second time in two years, Egypt's military leaders announced they have forced the country's president from office, relieving him of his command and replacing him with an executive of their choosing.
It was an odd thing to celebrate. Just 29 months ago, many of these same people had occupied Tahrir Square and cheered the prospects of democracy finally coming to Egypt. This warm night in July, they were welcoming back a military-led transition in place of a democratically elected president.
More than that, the people were flexing their political muscles. It had taken almost three weeks of bloody clashes to trigger the military's dismissal of Hosni Mubarak in 2011; it took just three days of mostly peaceful protest to similarly end the Morsi era.
The ouster of Mohammed Morsi, like that of his predecessor, will send reverberations beyond this country's borders. This time, however, leaders abroad are grappling with the failure of democracy in a place that once was a crucible of hope.
Along with Mr. Morsi's ouster came an appointed president with extraordinary powers, new laws to rein in media and the prospect of Egypt's most extreme religious movement becoming the biggest beneficiary of this new political reality.
With military personnel deployed across the capital and in other cities, Apache helicopters flying over the centre of Cairo, the Presidential Guard barracks being ringed in barbed wire and soldiers barring entry to the state Radio-TV Building, it certainly looks like a military coup has taken place.
The military leaders have laid out a "road map" for a transition back to democracy. As interim president they have chosen Adly Mansour, recently appointed head of the country's top constitutional court.
U.S. President Barack Obama said in a statement that he is "deeply concerned" about Mr. Morsi's ouster and the suspension of the nation's constitution and asked the military to restore democracy.
"I now call on the Egyptian military to move quickly and responsibly to return full authority back to a democratically elected civilian government as soon as possible through an inclusive and transparent process."
Mr. Morsi's removal from office didn't go down well in the nearby area known as Nasser City where thousands of angry Morsi supporters could do little more than grumble at the military's pronouncement. Egyptian soldiers and armoured personnel carriers ringed the supporters' gathering, while their ousted leader counselled restraint.
On his Twitter account, Mr. Morsi called on his followers to resist the use of violence. At the same time, however, he provocatively called on the country's soldiers to defend the constitution that the "coup" was attempting to suspend – in short, to disobey their military commanders.
Mr. Morsi was placed under house arrest earlier Wednesday, even before the army-imposed 48-hour deadline for settling a dispute with opposition forces had expired. He was taken from the Presidential Palace and closeted in the nearby barracks of the Presidential Guard.
From the moment the military's ultimatum was announced Monday afternoon, Mr. Morsi's political fate had been decided. There was only one outcome that would satisfy the opposition – an unlikely coalition of supporters of former president Hosni Mubarak, liberals, Coptic Christians and youthful activists that was joined in recent days by the police and even by the country's largest Salafist organization. Taken together their one goal was to dump Mr. Morsi and hold new elections.
For most Egyptians, it is the country's economy that affects them most and the Morsi year did little to instill confidence in that. Business has not recovered from the chaos and lack of confidence that followed Mr. Mubarak's ouster. Foreign investment continued to drop, deals for financing from the International Monetary Fund failed to materialize and tourism dried up.
Defence Minister General Abdel Fattah Al Sisi, in a terse statement read over state television, announced that Mr. Morsi no longer was to be regarded as president and that Adly Mansour, a judge who had been appointed as head of the country's constitutional court earlier this week, would be sworn in as a transitional president.
A strident opponent of the Morsi constitution voted on in December, Mr. Mansour is to have the power to appoint a constitutional council to draft a new basic law under which parliamentary and presidential elections would be held. Those elections would not likely take place until some time next year. It is the kind of power Mr. Morsi sought but for which he was roundly criticized.
The appointment is a bit of poetic justice for Mr. Mansour and his colleagues on the constitutional court. These were the judges who had been prevented from entering their court for several weeks last year by a gang of thugs from the Muslim Brotherhood camping out in front of the courthouse.
Members of the ruling party had not wanted the court to rule on the constitutionality of a constituent assembly that had drafted a new constitution last fall. That constitution, favoured by Islamists but feared by secular and Christian Egyptians, had been the thing that angered Egyptians most and sent them on the path to call for Mr. Morsi's ouster.
Jihad el-Haddad, an aide to Khairat el-Shater, a leading Muslim Brotherhood ideologue and deputy head of the Justice and Development Party, says the military's actions are nothing short of "a full-fledged military coup."
"This is the end of democracy in Egypt," he said, "or at least the first try at democracy."
"Not at all," says Hisham Kassem, the founding publisher of the country's independent newspaper Al Masry Al Youm. "It's not the end of democracy, it's a correction to democracy," he said.
"A military coup is something you wake up to suddenly," explained Mr. Kassem, who had been the founding chairman of the Egyptian Organization for Human Rights. "This is being done in the open with the full support of the majority of Egyptians."
Among that majority, the Salafist Nour Party, the largest Salafist organization, announced Wednesday it too favoured new election. A spokesman explained that it was decided to follow this approach as a way of keeping peace.
The reality is that the Salafists, and especially the Nour Party, have the most to gain in new elections when their long-time Islamist rival, the Brotherhood, has been discredited.