* Huge demonstrations planned to unseat President Mursi
* Violence feared as Islamists defend electoral mandate
* With economy in crisis, Obama urges talk, not fighting
* Deaths in recent days raise fears for regional stability
Mass demonstrations across Egypt on Sunday may determine its future, two and half years after people power toppled a dictator they called Pharaoh and ushered in a democracy crippled by bitter divisions.
The protesters' goal again is to unseat a president, this time their first freely elected leader, the Islamist Mohamed Mursi. Liberal leaders say nearly half the voting population - 22 million people - have signed a petition calling for change.
But with the long dominant, U.S-funded army waiting in the wings, and world powers fearing violence may unhinge an already troubled Middle East, Mursi's Muslim Brotherhood and militant allies pledge to defend what they say is the legitimate order.
Several people have been killed, including an American student, and hundreds were wounded in days of street fighting.
Mursi calls opponents bad losers backed by "thugs" from the rule of Hosni Mubarak. He is banking on the "Tamarud - Rebel!" coalition fizzling out, as other challenges in the streets have done since he took power a year ago on Sunday.
An economic crisis deepened by unrest and political deadlock may spur many less partisan Egyptians to join the rallies, due to start in the afternoon in Cairo. But many, too, are weary of turmoil and are sceptical that the opposition's demand to reset the rules of the new democracy is better than soldiering on.
U.S. President Barack Obama called on Egyptians to focus on dialogue. His ambassador to Egypt has angered the opposition by suggesting protests are not helping the economy.
Liberal leaders, fractious and defeated in a series of ballots last year, hope that by putting millions on the streets they can force Mursi to relent and hand over to a technocratic administration that can organise new elections.
"We all feel we're walking on a dead-end road and that the country will collapse," said Mohamed ElBaradei, former U.N. official, Nobel laureate and liberal party leader. "All Egypt must go out tomorrow to say we want to return to the ballot box, and build the foundations of the house we will all live in."
Religious authorities have warned of "civil war". The army has said it will step in if violence gets out of control but insists it will respect the "will of the people".
Mursi, who on Saturday met the head of the military he appointed last year, interprets that to mean army support for election results. Opponents believe that the army may heed the popular will as expressed on the streets, as it did in early 2011 when the generals decided Mubarak's time was up.
That would depend on a massive turnout, which is uncertain. Islamists suspect that agents of the old order are intent on shedding blood to trigger a military intervention.
In Cairo, thousands of people gathered on Tahrir Square, the seat of the Jan. 25 uprising of 2011, some saying they will camp out until Mursi goes. Others gathered outside the presidential palace several miles away, which was under heavy guard.
In a nearby suburban neighbourhood, the Muslim Brotherhood and allies who include former militant organisations, have set up camp outside a mosque. Guarded by baton-wielding civilians in protective clothing, the Islamists say they will defend Mursi.
Both sides say they want to avoid violence but that has not prevented incidents in which the Brotherhood says several of its offices around the country have been attacked and at least five of its supporters killed in the past week.
"It will be imperative for peaceful protesters to clearly separate themselves from the thugs that use them as cover," an aide to Mursi said. "And it will be more important for the leaders calling for these protests to back away from the language of violence and demonisation."
The United States has evacuated non-essential diplomatic staff and families and Obama said protecting U.S. missions was a priority. He was criticised at home when the ambassador to Libya was killed last year in an attack on the consulate in Benghazi.
The Egyptian army, half a million strong and financed by Washington since it backed a peace treaty with Israel three decades ago, says it has deployed to protect key installations.
Among these is the Suez Canal. Cities along the vital global waterway are bastions of anti-government sentiment. A bomb killed a protester in Port Said on Friday. Beyond the canal, in the Sinai peninsula which borders Israel and the Gaza Strip, a police general was gunned down in an ambush on Saturday.
Visiting the other end of Africa, Obama said in Pretoria: "Every party has to denounce violence ... We'd like to see the opposition and President Mursi engage in a more constructive conversation about how they move their country forward because nobody is benefiting from the current stalemate."
Mursi renewed an offer last week to include opponents in a new panel to review a controversial new constitution and has complained of a media campaign of vilification. The authorities have taken legal action against journalists and owners.
Opponents cite that among evidence that the Brotherhood, suppressed for decades under Mubarak, aims to use its organised, vote-winning power to entrench itself and its Islamic agenda deep in the state, in much the same way as the ousted leader.
Observers note similarities with protests in Turkey this month, where an Islamist prime minister with a strong electoral mandate has been confronted in the streets by angry secularists.
With much of the Arab world in turmoil after the uprisings that also brought sectarian civil war to Syria, the fate of its biggest nation may be determined by events in the coming days.