Egyptian president Mohammed Morsi has vowed to stay in power and defend constitutional legitimacy as generals worked on plans to push him aside within the day and suspend the constitution.

Key points

Mohammed Morsi vows to defend his office

Army gives Morsi ultimatum to meet the "people's demands"

Army reportedly planning to dissolve parliament if deadline not met

Several cabinet ministers resign

Biggest protests since Hosni Mubarak toppled

In a defiant midnight television address responding to military demands that he share power with his opponents, Mr Morsi warned that any deviation from the democratic order approved in a series of votes last year would lead Egypt down a dangerous path.

He was speaking as vast crowds of protesters rallied in central Cairo and across the nation to demand the Muslim Brotherhood politician's resignation in a third night of mass demonstrations.

His supporters also turned out and 16 were killed and 200 wounded as an unidentified gunmen opened fire at a rally at Cairo University.

"The price of preserving legitimacy is my life," Mr Morsi said in an impassioned, repetitive, 45-minute address.

"Legitimacy is the only guarantee to preserve the country.

"The Egyptians declared to the whole world that they have elected a president in a free manner. They declared and defined their path."

Mr Morsi has been locked in crisis talks with the head of the army, General Abdel Fattah al-Sisi, while several of his ministers have abandoned the government.

Military sources say that once a deadline set by General Sisi expires at 5:00pm on Wednesday (1:00am Thursday AEST), the military intends to install an interim council composed of civilians from different political groups and experienced technocrats, to run the country until an amended constitution is drafted.

That would be followed by a new presidential election, but parliamentary polls would be delayed until strict conditions for selecting candidates were in force, they said.

They would not say how the military intended to deal with Mr Morsi if he refused to go quietly, but after the president's address the high command said the army was "ready to die to defend Egypt's people against terrorists and fools", in a response headlined "The final hours".

The Egyptian military allowed its troops yesterday to be filmed undergoing hand-to-hand combat training. It was very dramatic to look at. They were doing things like leaping onto the front of a rolling dump truck, climbing over it and jumping off the back. So the military is making sure there are images out there of them being prepared to do what's necessary on the streets if they're called upon.

Country pushed to brink of chaos

The confrontation has pushed the most populous Arab nation closer to the brink of chaos amid a deepening economic crisis two years after the overthrow of Hosni Mubarak, raising concern in Washington, Europe and neighbouring Israel.

The liberal opposition coalition has ruled out starting negotiations with Mr Morsi, saying they are simply waiting for the expiry of the deadline.

After that, their negotiator, former UN nuclear agency chief Mohamed El Baradei, would deal directly with the military.

The military sources said the armed forces planned to open talks with the opposition National Salvation Front (NSF) and other political, religious and youth organisations after the deadline.

The emerging military roadmap could be amended as a result of those consultations, they said.

Among figures being considered as an interim head of state was the new president of the constitutional court, Adli Mansour.

The army blueprint closely resembles proposals for a democratic transition put forward by the NSF.

The military sources said the new transition arrangements would be entirely different from the military rule that followed Mubarak's fall.

Then, the armed forces council held effective power but was widely criticised by liberal and left-wing politicians for failing to enact vital economic and political reforms, and siding with the Muslim Brotherhood.

Senior Muslim Brotherhood leaders have branded the military ultimatum a "coup", but newspapers across the political spectrum saw the military ultimatum as a turning point.