Egyptians were on edge today after supporters and opponents of ousted president Mohammed Morsi fought overnight street battles that left at least 30 dead across the increasingly divided country.

Cairo's emblematic Tahrir Square and nearby approaches to the River Nile were largely empty but left strewn with debris. Thousands of Morsi's Islamist supporters had marched to the area demanding his reinstatement but ended up fleeing under a hail of stones, fireworks and sometimes gunfire.

Enraged at his overthrow by millions of protesters backed by the country's powerful military, tens of thousands of Morsi's supporters took to the streets on Friday, holding rallies they say they will continue until the former leader is returned to office.

The chaotic scenes that played out in the capital, mostly on a bridge leading to Tahrir, ended only after the army moved in with armoured vehicles to separate the warring groups. Some of Morsi's opponents jumped on at least one vehicle to try to show that the military was on their side.

The clashes had accelerated after the supreme leader of Morsi's Muslim Brotherhood defiantly proclaimed his followers would not give up street action until the return of the country's first freely elected president. Morsi's opponents had called out the public to defend against the Brotherhood, deepening the battle lines.

"God make Morsi victorious and bring him back to the palace," Brotherhood chief Mohammed Badie proclaimed on Friday before cheering supporters at a Cairo mosque in his first appearance since the overthrow. "We are his soldiers we defend him with our lives."

Badie said it was a matter of honour for the military to abide by its pledge of loyalty to the president, in what appeared to be an attempt to pull it away from its leadership.

Hours later, his deputy, Khairat el-Shater, considered the most powerful figure in the organisation, was arrested in a Cairo apartment along with his brother on allegations of inciting violence, Interior Ministry spokesman Hani Abdel-Latif said.

After the speech, a large crowd of Islamists surged across 6th October Bridge over the Nile toward Tahrir, where a giant crowd of Morsi's opponents had been massed all day. Battles broke out there and near the neighbouring state TV building. Pro-Morsi youth shielded themselves from flying stones and fireworks with sheets of metal. A car burned at the top of an exit ramp amid the sounds of automatic weapons and shotguns. At least three people were killed at the bridge.

Across the country, clashes erupted as Morsi supporters tried to storm local government buildings or military facilities, battling police or Morsi opponents. Besides the 30 killed throughout the day, some 210 were wounded, Heath Ministry official Khaled el-Khatib said.

Islamists descended on an anti-Morsi rally, opening fire with guns in the Mediterranean coastal city of Alexandria, where at least 12 people were killed, mostly Morsi opponents, emergency services official Amr Salama said. One man was stabbed and thrown from the roof of a building by Morsi supporters after he raised an Egyptian flag and shouted insults against the ousted president, according to an Associated Press reporter at the scene.

Militants killed five policemen in shootings around the Sinai city of el-Arish, according to security officials.

An interim president - senior judge Adly Mansour - was sworn in Thursday, and a cabinet of technocrats is to be formed to run Egypt until new elections can be held, although officials have not said when that will be. Mansour dissolved the interim parliament - the upper house of the legislature - which was overwhelmingly dominated by Islamists and Morsi allies. He also named the head of General Intelligence, Rafaat Shehata, as his security adviser.

The Brotherhood has said it will not work with the new military-backed leadership, and Morsi's supporters say the armed forces have wrecked Egypt's democracy by carrying out a coup against an elected president.

They accuse loyalists of former leader Hosni Mubarak, ousted in 2011, and liberal and secular opposition parties of turning to the army for help because they lost the election to Islamists. Many also see it as a conspiracy against Islam.

Friday's turmoil began in the afternoon when army troops opened fire as hundreds of his supporters marched on the Republican Guard building in Cairo. That site is where Morsi was staying when he was toppled before being taken into military custody at an undisclosed location.

The crowd approached a barbed wire barrier where troops were standing guard. When one person hung a sign of Morsi on the barrier, soldiers tore it down and told the crowd to stay back. A protester put up a second sign, and the soldiers opened fire, according to an AP photographer.

A protester fell dead with a gaping, bleeding wound in the back of his head, while others were bloodied and wounded. Witnesses told AP Television News at the scene that men in plain clothes fired the lethal shots. The Health Ministry said a total of four were killed at the site, though it was not known how all died.

Badie, made his appearance three hours later on a stage in front of tens of thousands of Islamists massed at Rabia al-Adawiya Mosque, not far from the Republican Guard building.

The circumstances of his appearance were a mystery. Security officials had said he was taken into custody from a villa on the Mediterranean coast soon after Morsi's removal Wednesday night and flown to Cairo, part of a sweep that netted at least five other senior Brotherhood figures and put around 200 more on wanted lists.

Fears have been running high over an Islamist backlash to Morsi's overthrow. Extremist Islamist groups that gained considerable freedom to operate during Morsi's year in office have already vowed violence in retaliation.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.