Egypt's army held ousted president Mohamed Morsi at a military facility in Cairo on Thursday. Other Muslim Brotherhood leaders were arrested in a crackdown on the movement that won several elections last year.
The United Nations, the United States and other world powers did not condemn Morsi's removal as a military coup. To do so might trigger sanctions. Army intervention was backed by millions of Egyptians, including liberal leaders and religious figures, who expect new elections under a revised set of rules.
But as vast crowds partied on Cairo's Tahrir Square, hailing a "second revolution" to match the overthrow of Hosni Mubarak in 2011, Islamists feared a clampdown that revived memories of their sufferings under the old, military-backed regime. At least 14 people were killed and hundreds were wounded in street clashes.
Television stations sympathetic to Morsi were taken off air.
Morsi himself was transported to the Defence Ministry, Brotherhood spokesperson Gehad El-Haddad said. His aides were being held at the Republican Guard barracks where he spent his final day in office defying calls for him to resign but unable to forestall an ultimatum from the generals.
The fall of the first elected leader to emerge from the Arab Spring revolutions raised questions about the future of political Islam, which only lately seemed triumphant. Deeply divided, Egypt's 84-million people find themselves again a focus of concern in a region traumatised by the civil war in Syria.
Straddling the Suez Canal and a key piece in the security of Israel, many powers have an interest in Egypt's stability.
The army put combat troops and tanks on the streets around a gathering of hundreds of Morsi's supporters in Cairo. The military said it would keep order. Morsi called for there to be no violence.
The clock started ticking for Morsi when millions took to the streets on Sunday to demand he resign. They accused his Brotherhood of hijacking the revolution, entrenching its power and – critically for many – failing to revive the economy.
That gave armed forces chief General Abdel Fattah al-Sisi, who already had his own reservations about the state of the nation under Morsi, a justification to invoke the "will of the people" and demand the president share power or step aside.
The United States and other Western allies also pressed Morsi hard to open his administration to a broader mix of ideas.
Morsi railed on television about his electoral legitimacy. He called his liberal opponents bad losers, in league with those secretly still loyal to Mubarak and pledged his life to remain in power. Aides said he would prefer to "die standing like a tree". Liberal leaders said he was "losing his mind" and met to agree on a plan with Sisi.
What was unveiled by the general, in full uniform, flanked by politicians, officers and clergy, was a road map to wipe clear a slate of messy democratic reforms enacted since Mubarak fell. The constitution was suspended. The constitutional court chief justice, Adli Mansour, will be sworn in to replace Morsi at 10am (8am GMT).
A technocratic interim government will be formed, along with a panel for national reconciliation. The constitution will be reviewed, and presidential and parliamentary elections arranged.
There was no timetable. Liberal chief negotiator Mohamed ElBaradei, a former UN nuclear agency chief, said the plan would "continue the revolution" of 2011. Many hope they can have more electoral success than last year, when the Brotherhood's organisation dominated the elections.
Its own ability to fight back democratically may be limited by the arrests of its leaders. They face accusations of inciting violence. Morsi may also face charges. His opponents accused him this week of fomenting "civil war" by defying Sisi's ultimatum.
The state newspaper said arrest warrants had been issued for 300 Brotherhood members.
United Nations secretary general Ban Ki-moon urged a swift return to civilian rule, restraint and respect for civil rights.
He did not, however, condemn the military action. He said: "Many Egyptians in their protests have voiced deep frustrations and legitimate concerns … At the same time, military interference in the affairs of any state is of concern."
US President Barack Obama, whose administration provides $1.3-billion a year to the Egyptian military, expressed concern about Morsi's removal and called for a swift return to a democratically elected civilian government. But he, too, stopped short of condemning a military move that could block US aid.
"During this uncertain period, we expect the military to ensure that the rights of all Egyptian men and women are protected, including the right to peaceful assembly, due process, and free and fair trials in civilian courts," he said.
Obama urged the new authorities to avoid arbitrary arrests and said US agencies would review whether the military action would trigger sanctions on aid. A senator involved in aid decisions said the United States would cut off its financial support if the intervention was deemed a military coup.
Definition of 'coup'
But much may depend on a strict definition of "coup."
Concerns over human rights have clouded US relations with Cairo, but did not stop aid flowing to Mubarak, or to Morsi.
The European Union, the biggest civilian aid donor to its near neighbour, also called for a rapid return to the democratic process. Foreign policy chief Catherine Ashton said in a statement that should mean "free and fair presidential and parliamentary elections and the approval of a constitution."
She stressed the need for inclusive politics but did not mention the constitution and elections already held in the past two years, whose results the armed forces have now cast aside.
Sisi said: "Those in the meeting have agreed on a road map for the future that includes initial steps to achieve the building of a strong Egyptian society that is cohesive and does not exclude anyone and ends the state of tension and division."
Reflecting the hopes of the "revolutionary youth" who led the charge against Mubarak, only to see the electoral machine of the Brotherhood dominate the new democracy, the young man who proved Morsi's extraordinary nemesis said the new transitional period must not repeat the mistakes of the recent past.
"We want to build Egypt with everyone and for everyone," said Mahmoud Badr, a 28-year-old journalist who first had the idea two months ago for a petition calling on Morsi to resign. By last weekend, the "Tamarud – Rebel!" movement was claiming 22-million backers, many of whom were on the streets on Sunday.
Morsi's overthrow may have repercussions in Tunisia, whose uprising prompted Egyptians to take on Mubarak, the last in a 60-year line of military-backed rulers. Tunisia now has its own Tamarud movement, seeking to end Islamist government.
On Tahrir Square, cradle of Egypt's January 25 revolution in 2011, huge crowds in the hundreds of thousands set off fireworks and partied, chanting: "The people and the army are one hand!"
The past four days have seemed to many like a fast-motion rerun of the 18 days that brought down Mubarak, when the army that had long backed him realised his time was up.
?In addition to three TV channels that went off air, including one owned by the Brotherhood, the authorities arrested a staffer at Egypt's Al Jazeera Mubasher, owned by the Gulf state of Qatar. The emirate is seen as close to the movement.
Saudi Arabia, in contrast, has long been suspicious of the Brotherhood's international ambitions. King Abdullah sent a message of congratulations to the man replacing Morsi. The United Arab Emirates also welcomed the change in Cairo.
Oil prices initially rose on fears that unrest in Egypt could destabilise the Middle East and lead to supply disruption but prices retreated after the army toppled the president.
With Egypt's economy left ragged by the unrest of the past two and half years, Morsi had been helped by gifts and loans from Qatar. The new authorities may hope for help from other quarters. Notably, an International Monetary Fund loan has long been stalled.
The official spokesperson of the Muslim Brotherhood said supporters were willing to become martyrs to defend Morsi.
But the Brotherhood also has an 85-year history of survival and may take a long view of whether it is better to draw in its horns and watch others try to reform Egypt's sclerotic economy.
A Brotherhood official, Gamal Heshmat said: "There is absolutely no direction towards violence. The Brotherhood are not raised on violence. Their cause is a peaceful one, defending their rights, which is stronger than a military coup." – Reuters