At least 211 people were injured in the fighting.
By early afternoon local time, a large pro-government group had laid claim to the area in a mass show of force, forcing opponents of President Mohammed Morsi and his power decrees to retreat after holding their own massive protest the previous day.
Four more presidential advisers also quit in protest over Morsi's handling of the crisis. They were the latest resignations after two aides on Morsi's panel abandoned him.
As night fell, it was evident that a number of Morsi opponents were refusing to disperse and that the two sides were becoming increasingly violent.
An anti-government crowd of around 100,000 had gathered near the palace on Tuesday and some of them stayed overnight, leading the Muslim Brotherhood to call for its own rally near the palace.
"Escalation is the word here tonight after the worst violence this country has seen since Hosni Mubarak was overthrown," CBC's David Common reported from Cairo, adding that some journalists had been attacked by Muslim Brotherhood supporters.
"It seemed quite clear the opposition realized they were outnumbered and they had to retreat with some haste."
People in the group supporting Morsi were seen wielding sticks, swords and bats, and there was "limited rock throwing," Common said.
The president returned to work at the presidential palace Wednesday morning despite the sit-in protest. Morsi had left the complex through a back gate the night before as tens of thousands of protesters pushed through a barricade and approached the palace. Officials say the president used an exit he routinely uses and left at the end of his working day.
At one point during the protest, police fired tear gas at the crowd. A brief outburst of violence left 18 people wounded, none seriously, according to the official MENA news agency.
Protesters had gathered to demand that Morsi rescind decrees that place him above judicial oversight.
The president's Nov. 22 decrees and the adoption by Morsi's allies of a controversial draft constitution have plunged Egypt into its worst political crisis since Hosni Mubarak was overthrown as president nearly two years ago.
Morsi has called a Dec. 15 referendum on a new constitution, hoping to end the protests.
Secular politicians fear the Islamist-dominated panel that is drafting the constitution will produce a draft that infringes on the rights of women and religious minorities.
"Morsi and the Muslim Brotherhood have been banished to the political sidelines for eight decades now. They aren't going to be quick to rescind any power whatsoever, and so we are looking at more volatility and a stand-off, because this president does not appear willing to yield to these enormous protests that took place last night," Common said.
Five Egyptian satellite stations Wednesday announced plans to strike as part of the protest. ONTV, Dream, Capital Broadcasting Centre, Al-Hayat and Al-Nahar stations said they will stop broadcasting from 6 p.m. to midnight local time.
"We are protesting against the lack of freedom for the media and recent efforts to silence journalists," said Mohamed Bassiouni, executive producer at ONTV.
U.S. Secretary of State Hillary Clinton said Egypt's unrest shows the urgent need for dialogue between the government and opposition on reshaping a constitution.
Speaking at NATO headquarters in Brussels on Wednesday, Clinton said the U.S. wants to see a constitution emerge that protects the rights of all Egyptians — men and women, Christian and Muslim.