At least five people have been killed in clashes between opponents and supporters of Egypt's deposed president Mohammed Morsi, who was overthrown by the military.
The army moved against Morsi overnight, removing him from power and calling early elections.
Morsi has been replaced by the chief justice of the Supreme Constitutional Court, Adli Mansour, while the army has also suspended the Islamist-backed constitution.
Army chief Abdel-Fattah el-Sissi, in a televised address to the nation early today (NZ time), said a government of technocrats will be appointed to run the country during a transition period he did not specify.
Military and judicial sources have said Mansour will be sworn in as interim head of state tonight (NZ time).
After the announcement, gunfire broke out as rocks and bricks flew in the Mediterranean city of Alexandria, witnesses said.
At least one person was killed and 50 were wounded, state news agency MENA reported, quoting a local medical official.
''We are dealing with the situation ... We have called for security reinforcements in the area,'' said senior police officer Sherif Abdelhamid.
Four people were also killed in clashes in the northern city of Marsa Matrouh, the state governor said.
Governor Badr Tantawi told Reuters by telephone from the Mediterranean city close to the Libyan border that the dead were Mursi supporters.
US President Barack Obama has urged Egypt's military to hand back control to a democratic, civilian government without delay, but stopped short of calling the ouster of President Mohammed Morsi a coup d'etat.
In a carefully worded statement, Obama said he was "deeply concerned" by the military's move to topple Morsi's government and suspend Egypt's constitution.
He said he was ordering the US government to assess what the military's actions meant for US foreign aid to Egypt - US$1.5 billion a year in military and economic assistance.
Under US law, the government must suspend foreign aid to any nation whose elected leader is ousted in a coup.
"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, and to avoid any arbitrary arrests of President Morsi and his supporters," Obama said.
The US wasn't taking sides in the conflict, committing itself only to democracy and respect for the rule of law, Obama said.
An aide of ousted Morsi, Ayman Ali, said the former leader had been moved to an undisclosed location. He gave no details.
A statement on the Egyptian president's office's Twitter account has quoted Morsi as calling military measures "a full coup."
The denouncement was posted shortly after the Egyptian military announced it was ousting Morsi, who was Egypt's first freely elected leader but drew ire with his Islamist leanings.
Morsi was quoted as saying those measures "represent a full coup categorically rejected by all the free men of our nation."
After the televised announcement by the army chief, millions of anti-Morsi protesters in cities around the country erupted in delirious scenes of joy, with shouts of "God is great" and "Long live Egypt."
Fireworks burst over crowds dancing and waving flags in Cairo's Tahrir Square, epicentre of the 2011 uprising that ousted autocrat Hosni Mubarak. Now it was one of multiple centres of a stunning four-day anti-Morsi revolt that brought out the biggest anti-government rallies Egypt has seen, topping even those of 2011.
Egypt's second-biggest Islamist party said it had agreed to an army political "road map" that suspends the constitution so that the country can avoid conflict.
"We took this position and we took these decisions only so we stop the bloodshed of our people," Galal Murra, Nour's secretary general, said in a televised broadcast.
However, Morsi supporters in Cairo were heard shouting "No to military rule."
In another development, the television station of Egypt's Muslim Brotherhood has been taken off air and its managers arrested.
The Egypt25 channel had been broadcasting live coverage of rallies by tens of thousands of pro-Mursi demonstrators in Cairo and around the country, with speeches by leading Brotherhood politicians denouncing the military intervention to oust the elected president.
'THE FINAL HOURS'
The Arab world's most populous nation has been in turmoil since the fall of Mubarak as Arab Spring uprisings took hold in early 2011, arousing concern among allies in the West and in Israel, with which Egypt has a 1979 peace treaty.
The elected Muslim Brotherhood president, in office for just a year, remained out of sight in a Republican Guard barracks surrounded by barbed wire, barriers and troops, but military sources denied media reports that he was under arrest.
"For the sake of Egypt and for historical accuracy, let's call what is happening by its real name: military coup," Morsi's national security adviser Essam El-Haddad said in a statement, warning of "considerable bloodshed" to come.
Military chiefs, vowing to restore order in a country racked by protests over Morsi's Islamist policies, earlier issued a call to battle in a statement headlined "The Final Hours". They said they were willing to shed blood against "terrorists and fools" after Morsi refused to give up his elected office.
Military chiefs also said the entire senior leadership of his Muslim Brotherhood were banned from leaving the country.
Security sources told Reuters the authorities had sent a list of at least 40 leading members of the Brotherhood to airport police.
As the ultimatum expired, hundreds of thousands of anti-Morsi protesters in Tahrir Square in central Cairo let off fireworks, cheered and waved Egyptian flags in celebration.
US oil prices rose to a 14-month high above US$100 a barrel partly on fears that unrest in Egypt could destabilise the Middle East and lead to supply disruption.
The massive protests showed that the Brotherhood had not only alienated liberals and secularists by seeking to entrench Islamic rule, notably in a new constitution, but had also angered millions of Egyptians with economic mismanagement.
Tourism and investment have dried up, inflation is rampant and fuel supplies are running short, with power cuts lengthening in the summer heat and motorists spending hours fuelling cars.
-AP and Reuters