The head of Egypt's Constitutional Court, Adli Mansour, was sworn in as interim president on Thursday, a day after the army ousted Mohamed Morsi as head of state.
Speaking at the Constitutional Court in Cairo, Mansour said he planned to hold new elections, but did not specify when. He said Egypt had "corrected the path of its glorious revolution" through mass street protests calling for Morsi's resignation, which ultimately sealed his fate.
Morsi and several leaders of his Muslim Brotherhood movement were being held at various locations by security services, after the leader defied calls to resign but was ultimately unable to forestall an ultimatum from the generals to cede power.
Thursday's newspapers greeted Morsi's overthrow as a triumph for Egyptians, even though the Brotherhood won several elections last year.
"Victory for the legitimacy of the people," declared the Al-Gomhuria state newspaper in its banner headline, printed over a photograph of hundreds of thousands of people crammed into Tahrir Square in Cairo, the focal point of anti-Morsi protests.
The United Nations, the United States and other world powers did not condemn Morsi'sremoval 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 calm returned to the streets of Cairo and other cities, Islamists feared a clampdown that revived memories of their sufferings under the old, military-backed regime led by Hosni Mubarak, himself toppled by a popular uprising in 2011.
At least 14 people were killed and hundreds wounded in street clashes. Television stations sympathetic to Morsi were taken off air. The fall of Egypt's first elected leader after the Arab uprisings of 2011 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 Israel's biggest neighbour, Egypt's stability is important for many powers.
The army put combat troops and tanks on the streets around a gathering of hundreds of Morsi supporters in Cairo. The military promised to keep order and Morsi said there should 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 had 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. He pledged his life. 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.
A technocratic interim government will be formed, along with a panel for national reconciliation, and the constitution will be reviewed.
As yet there is no timetable for new elections. 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 vote. 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.
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 State would cut off its financial support if the intervention was deemed a military coup.
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 Jan 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.
With Egypt's economy run 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 IMF loan has long been stalled.
The official spokesman 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, told Reuters: "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."