The Egyptian army sealed off the presidential palace with barbed wire and armoured vehicles as protesters defied a deadline to vacate the area, pressing forward with demands that Islamist leader Mohammed Morsi rescind decrees giving himself near-absolute power and withdraw a disputed draft constitution.
Inside the palace gates, Mr Morsi met with members of his cabinet and military leaders to discuss the expanding crisis after fierce street battles in an upscale residential suburb of Cairo killed five people and left more than 600 injured in the worst outbreak of violence between the two sides since the Islamist leader's election.
The intensity of the overnight violence, with Mr Morsi's Islamist backers and largely secular protesters lobbing firebombs and rocks at each other, raised the spectre that the two-week-old crisis that has left the country sharply divided would grow more polarised and violent.
The army's Republican Guard, an elite unit assigned to protect the president and his palaces, surrounded the complex and gave protesters on both sides until 3pm local time (1300 GMT) to clear the vicinity, according to an official statement. The statement also announced a ban on protests outside any of the nation's presidential palaces.
But a group of several dozen anti-Morsi protesters continued to demonstrate across the street from the palace past the military's deadline, chanting slogans against the president. And organisers called for a larger evening rally. Meanwhile, members of the Muslim Brotherhood and other Islamists supporting Mr Morsi withdrew from the area after an overnight sit-in.
Inside the palace gates, Mr Morsi held crisis meetings with cabinet members and military leaders, including the defence minister, according to a presidential statement. "The president discussed ways to deal with the situation regarding the political, security and legal landscapes so that Egypt can achieve stability and preserve the gains of the revolution," the statement said.
Egypt has seen sporadic clashes throughout nearly two years of political turmoil after Hosni Mubarak's removal in February 2011. But Wednesday's street battles were the worst between Mr Morsi's supporters and opponents.
The clashes began after an implicit call by the Muslim Brotherhood and its political party, to which the president belongs, for their members to go to the palace and stage a sit-in that would remove anti-Morsi protesters who were camped out there.
Unlike Mubarak, Mr Morsi was elected in June after a narrow victory in Egypt's first free presidential elections, but many activists who supported him have jumped to the opposition after he issued decrees on November 22 that put him above oversight and a draft charter was later rushed through by his Islamist allies despite a walkout by Christian and liberal factions. Compounding Mr Morsi's woes, four of his advisers resigned on Wednesday, joining two other members of his 17-member advisory panel who have abandoned him since the crisis began.
Six tanks and two armoured vehicles belonging to the Republican Guard were stationed on Thursday morning at roads leading to the palace in the upscale Cairo district of Heliopolis. The guard's commander, Major General Mohammed Zaki, sought to assure Egyptians that his forces were not taking sides. "They will not be a tool to crush protesters and no force will be used against Egyptians," he said in comments carried by the official MENA news agency.