The Egyptian army toppled Islamist President Mohamed Morsi after a week of bloodshed that killed nearly 50 people as millions took to the streets to demand an end to his turbulent single year of rule.
The announcement, made on state television by Morsi's own defence minister, armed forces chief General Abdel Fattah al-Sisi, drew a rapturous welcome from thousands of protesters who have camped out on the streets of Cairo for days.
Sisi laid out details of the roadmap for a political transition, saying the Islamist-drafted constitution would be frozen and presidential elections held early, without specifying when.
The armed forces would "remain far away from politics," he stressed.
Morsi is detained in a military facility with top aides, a senior member of the Muslim Brotherhood said Thursday.
"Morsi and the entire presidential team are under house arrest in the Presidential Republican Guards Club," Gehad El-Haddad, the son of a top Morsi aide, told AFP. Haddad's father, Essam El-Haddad, widely seen as Morsi's right-hand man, was among those held, he added.
A senior Islamist official later told AFP Morsi had been separated from senior aides detained in a military facility.
"Morsi has been separated from his aides and was taken to the defence ministry," said Gehad El-Haddad, a senior Muslim Brotherhood official and son of a top Morsi aide.
On hearing the news of Morsi's toppling tens of thousands of people took to the streets of the capital to celebrate, cheering, whistling, letting off firecrackers and honking car horns in joyous scenes.
"It's a new historical moment. We got rid of Morsi and the Muslim Brotherhood," said one celebrator, Omar Sherif.
In an amateur video posted online, Morsi declared "I am the elected president of Egypt" and urged people to "defend this legitimacy".
In the western city of Marsa Matruh, four Morsi supporters were killed in clashes with the army and police after they stormed the city's security headquarters.
Another Morsi supporter died in clashes in the Mediterranean coastal city of Alexandria, security officials said.
Security forces also arrested two key Muslim Brotherhood figures, the group's deputy leader Rashad Bayoumi and Saad al-Katatni, who heads the Brotherhood's political arm.
Warrants were issued for the arrest of a total of 300 Brotherhood officials, state media said. Morsi's own whereabouts were unclear.
The opposition Congress Party of former Arab League chief Amr Mussa insisted "this is not a coup".
"The 2,000-year-old Coptic Church, the 1,000-year-old Azhar mosque, the liberals, the Salafists (conservative Islamists), the police, the army are all behind the call for early elections," said a Congress spokesman.
Signup to our newsletter and follow us on Facebook and Twitter!
Morsi, Egypt's first freely elected president, came under massive pressure in the run-up to Sunday's anniversary of his maiden year in office, with his opponents accusing him of failing the 2011 revolution by concentrating power in the hands of his Muslim Brotherhood.
The embattled 61-year-old proposed a "consensus government" as a way out of the country's worst crisis since the 2011 uprising ended three decades of authoritarian rule by Hosni Mubarak.
But it failed to satisfy his critics and the army stepped in.
Its commander named the head of the Supreme Constitutional Court, Adly al-Mansour, a previously little known judge, as the new leader of the Arab world's most populous country. He is expected to swear in on Thursday.
US President Barack Obama said he was "deeply concerned" over Morsi's ouster, urging a quick return to elected civilian government.
Opposition leader Mohamed ElBaradei, former head of the UN nuclear watchdog, and the heads of the Coptic Church and Al-Azhar, Sunni Islam's highest seat of learning, sat alongside the armed forces chief as he announced Morsi's overthrow on state television.
The choreography was designed to show broad civilian support for the military's move to topple Morsi, which dashed the hopes of supporters who had seen his elevation to the presidency after years underground as one of the key achievements of the 2011 revolution.
Morsi's camp had earlier denounced the army's intervention as a coup.
"For the sake of Egypt and for historical accuracy, let's call what is happening by its real name: military coup," Essam al-Haddad, Morsi's national security adviser, said in a statement on Facebook.
As tension mounted and crowds poured onto the streets to demand Morsi's resignation, Haddad said: "As I write these lines I am fully aware that these may be the last lines I get to post on this page."
Egyptian security forces later pulled the plug on a Muslim Brotherhood television channel, a Morsi aide told AFP.
Staff of Al-Jazeera's Egyptian affiliate were also arrested after the channel aired a defiant speech by the deposed president, the aide added.
Dozens of armoured personnel carriers headed towards Islamist gatherings at Cairo University, Heliopolis and Nasr City where one official said they had encircled the pro-Morsi demonstrators to prevent chaos.
But in Cairo's Tahrir Square, the security forces looked on as tens of thousands of anti-Morsi protesters rallied in a demonstration that dwarfed that of the embattled president's supporters in Nasr City, on the opposite side of town.
The crowd swelled at nightfall, after a scorching day that saw police officers hand out water to the demonstrators in the middle of Tahrir, epicentre of the 2011 uprising.
The powerful military had issued a 48-hour deadline on Monday for Morsi to meet the "people's demands", a day after millions of protesters took to the streets calling for him to resign.
Washington confirmed that it had ordered out all of its embassy staff just hours after Morsi's overthrow. Most Western embassies had remained closed since before Sunday's mass protests.