Forty-two loyalists of Egypt's ousted president were killed on Monday while demonstrating against last week's military coup, triggering an Islamist uprising call and dashing the army's hopes for an interim civilian administration.
The Muslim Brotherhood, which has led demonstrations against the overthrow of Islamist president Mohamed Morsi last Wednesday, said its supporters were "massacred" when police and troops fired on them during dawn prayers outside an elite army headquarters in Cairo.
The military blamed "terrorists" while witnesses, including Brotherhood supporters at the scene, told AFP that the armed forces fired only tear gas and warning shots and that "thugs" in civilian clothes had carried out the deadly shooting.
Prominent liberal leader Mohamed ElBaradei called for an independent inquiry into the bloodshed. Turkey strongly condemned the killings.
The conservative Islamist Al-Nur party, which won almost a quarter of votes in a 2011 parliamentary election and had given its support to the army's overthrow of Morsi, said it was pulling out of talks on a new government in response to the "massacre".
The bloodshed happened outside the headquarters of the elite Republican Guard, whom the Brotherhood accuses of betraying Morsi.
Brotherhood supporters hurled stones at the security forces who responded with tear gas, as firefighters battled to extinguish a blaze that raged in an apartment block, an AFP correspondent reported.
"Morsi supporters were praying while the police and army fired live rounds and tear gas at them," the Brotherhood said.
A senior medical official told AFP at least 42 people were killed and 322 wounded.
The army said "armed terrorists" tried to storm the base, leaving one security officer dead and six critically wounded.
The Brotherhood's political arm, the Freedom and Justice Party, called for "an uprising by the great people of Egypt against those trying to steal their revolution with tanks".
It urged "the international community and international groups and all the free people of the world to intervene to stop further massacres... and prevent a new Syria in the Arab world".
A security official said prosecutors later ordered the closure of the FJP's Cairo headquarters after police discovered weapons that they alleged were to be used in attacks against Morsi opponents.
ElBaradei, a Nobel Peace laureate, called for an independent investigation.
"Violence begets violence and should be strongly condemned. Independent Investigation a must. Peaceful transition is only way," the former UN nuclear watchdog chief said on his official Twitter account.
The bloodshed came just hours before the caretaker president installed by the army, chief justice Adly Mansour, had been due to announce his choice of interim prime minister.
The violence followed another day of duelling demonstrations across the Arab world's most populous nation by supporters and opponents of Morsi, in an escalating crisis that analysts fear could spark an all-out civil war.
The military has come under mounting international pressure to swiftly install a civilian administration to oversee a rapid return to elected government.
But Al-Nur said it would no longer take part in talks on an interim administration.
"We have decided to withdraw immediately from all negotiations in response to the massacre outside the Republican Guard," its spokesman Nadder Bakkar said on Twitter.
The party had already voiced strong opposition to the appointment of ElBaradei, an outspoken liberal opponent of the Brotherhood, delaying efforts to form an interim government.
Mansour aides had said before the deadly violence that he was leaning towards appointing centre-left lawyer Ziad Bahaa Eldin as prime minister with ElBaradei as vice president and that an announcement would be made later on Monday.
Hundreds of thousands of Morsi opponents took to the streets of Cairo on Sunday to demonstrate their support for his overthrow.
"We are on the street to show the world that it was a popular revolution and not a coup that overthrew" Morsi, said a beaming teacher who gave her name as Magda.
Many banners expressed anger with the United States for what they perceive as its support for Morsi, as well as American media coverage depicting his ouster as a coup.
"America shame on you! This is a revolution, not a coup!" read one.
President Barack Obama insisted the United States was "not aligned" with any political party or group in Egypt following Morsi's ouster.
"The future path of Egypt can only be determined by the Egyptian people," the White House quoted him as saying.
Morsi's single year of turbulent rule was marked by accusations he failed the 2011 revolution that ousted autocratic president Hosni Mubarak by concentrating power in Islamist hands and letting the economy nosedive.