* Protesters swirl around presidential palace despite tanks
* Al-Ahram says army to get new security role
* Opposition boycotts President Mursi's "national dialogue"
Egypt's military on Saturday urged rival political forces to solve their disputes via dialogue and said the opposite would drag the country into a "dark tunnel", which it would not allow.
A statement by the military spokesman read on state media made no mention of President Mohamed Mursi, but said a solution to the political crisis roiling the most populous Arab nation should not contradict "legitimacy and the rules of democracy".
Egypt has plunged ever deeper into crisis since Mursi, who was freely elected in June, decreed himself wide powers on Nov. 22 and pushed ahead with plans for a referendum next Saturday on a constitution drafted by an Islamist-dominated assembly.
The army's duty was to protect national interests and secure vital state institutions, the military said. Egyptians could express their views "far from all displays of violence".
The statement, the army's most direct remarks so far on the the political confrontation between the Islamist president and his liberal opponents, was issued while protesters were still camped out by the gates of the presidential palace.
But it did not appear to indicate that the army, which ran Egypt for months after Hosni Mubarak's overthrow last year, was planning to retake control of the country or its turbulent streets.
A military source said the statement did not signal any plan for a intervention in politics or a broad role on the streets.
A senior Muslim Brotherhood official welcomed the army's remarks as "balanced" and neutral. Former Foreign Minister Amr Moussa, now an opposition leader, said the army was simply responding to an "enormously dangerous situation".
The military was the power behind all previous presidents and an army council temporarily took over after Mubarak's fall. However, Mursi pushed the generals aside in August and they had shown little appetite to intervene in Egypt's latest crisis.
"The armed forces affirm that dialogue is the best and only way to reach consensus," the statement said. "The opposite of that will bring us to a dark tunnel that will result in catastrophe and that is something we will not allow."
The state-run daily al-Ahram earlier reported that Mursi would soon authorise the military to help police keep order and give it powers of arrest under a decree approved by the cabinet. It did not say when the decree would be issued.
The instability in Egypt worries the West, especially the United States, which has given Cairo billions of dollars in military and other aid since it made peace with Israel in 1979.
The tens of thousands of Mursi foes who surged past tanks and barbed wire to reach the palace gates on Friday night had dispersed, but a hard core stayed overnight in a score of tents.
Some had spray-painted "Down with Mursi" on tanks of the elite Republican Guard posted there after clashes between rival groups killed at least seven people and wounded 350 this week.
Others draped the tanks with posters of Mursi and the word "Leave" scored across his face in red letters.
"We are no longer calling for scrapping the decree and delaying the referendum," Samir Fayez, a Christian protester at the palace, said. "We have one demand in five letters: leave."
Nearby, a Mursi supporter named Mohamed Hassan was quietly observing the scene. He suggested that the Muslim Brotherhood and its ultra-orthodox Salafi Islamist allies could easily overwhelm their foes if they chose to do mobilise their base.
"The Brotherhood and Salafis by themselves are few but they have millions of supporters who are at home and haven't taken it to the streets yet," murmured the 40-year-old engineer.
"HATE US, BUT TALK"
The Muslim Brotherhood's supreme guide, Mohamed Badie, denounced opposition protests that have swirled around the walls of the Mursi's palace, saying they "ruin legitimacy".
Badie said eight people, all of them Brotherhood members, had been killed this week and urged the interior minister to explain why police had failed to prevent assailants from torching the organisation's headquarters and 28 other offices.
"Get angry with the Brotherhood and hate us as much as you like, but be reasonable and preserve Egypt's unity," he told a news conference. "We hope everyone gets back to dialogue."
The turmoil has exposed deep divisions over the destiny of a country of 83 million where the removal of Mubarak 22 months ago led to a messy army-led transition, with the Brotherhood and its allies winning two elections.
The well-organised Brotherhood, which pushed Mursi from obscurity to power, remains his surest source of support, with over 80 years of religious and political struggle behind it.
Mursi was to host a "national dialogue" later on Saturday to chart a way forward, but opposition leaders have vowed to stay away unless he cancels his decree and defers the referendum.
Late on Friday, Prime Minister Hisham Kandil urged political forces to take "courageous and constructive steps" by calling off protests and joining the dialogue without preconditions.
Mursi's vice president has floated the possibility that the Dec. 15 vote on a constitution opposed by liberals, leftists, Christians and others might be delayed. But the concession would fall far short of meeting all the opposition's demands.
While the main opposition coalition is boycotting, Mursi's dialogue might be joined by some senior judges or politicians such as Ayman Nour, who was trounced when he ran for president in 2005, the only multi-candidate race of the Mubarak era.