Thousands of demonstrators in the Egyptian capital Cairo have joined rival rallies as emotions run high ahead of a planned referendum.

The opposition breached a barrier outside the presidential palace but there was no violence.

Islamist President Mohammed Morsi, who called the vote on Saturday to ratify a new constitution, has called on the army to maintain security.

Egypt has asked the IMF to delay a loan because of political turmoil.

Egypt requested the delay to the $4.8bn (£3.6bn) loan after President Morsi suspended a programme to increase taxes, Prime Minister Hisham Qandil told a news conference.

The International Monetary Fund says it "stands ready to continue supporting Egypt during the ongoing transition and to consult with the authorities on the resumption of discussions regarding the [loan]".

The Egyptian economy has been hard hit by nearly two years of political upheaval since the protests which toppled ex-President Hosni Mubarak in February 2011.

Tanks and soldiers

Arab Uprisings week on the BBC

Two years since a young Tunisian street trader's death began a wave of rebellion across the Arab world

Opposition marches from different parts of Cairo converged on the presidential palace, which has been walled off with concrete blocks and ringed with tanks.

Hundreds of soldiers are guarding the palace perimeter.

Opposition protesters breached the temporary wall, but the BBC's George Alagiah, who was at the scene, said the Republican Guard allowed the demonstrators through. Several thousand were in the presidential compound on Tuesday evening.

The military is allowed to arrest civilians but clearly decided not to use those powers, our correspondent said.

Islamist protesters who support President Morsi and the draft constitution are gathering around Tahrir Square.

There were also protests in the cities of Alexandria and Assiut.

The head of Egypt's Judges' Club has said 90% of judges are refusing to oversee the referendum. Under Egyptian law, judges are required to supervise the vote at each polling station.

Meanwhile the head of the military has called for a national dialogue to resolve the crisis.

Saying he was speaking only in a personal capacity, Abdel Fatah El-Sissi invited the opposition, along with judges, media leaders and Muslim and Christian clerics to an informal gathering on Wednesday.

"We will only sit together," he said on state television. "For the sake of every Egyptian, come and disagree. But we won't be cross with one another or clash."

Public anger

At least nine people were hurt early on Tuesday when shots were fired at opposition protesters in central Cairo.

The opposition wants the referendum scrapped, arguing that the constitution was drafted by an Islamist-dominated assembly, weakens human rights and fails to guarantee women's rights.

The president has tried to calm public anger by annulling a 22 November decree boosting his powers, but has given the army powers to arrest civilians until the results of Saturday's referendum are announced.

Saturday will be a national holiday to allow state employees to vote in the referendum, the state-run Mena news agency reported.

However, some rulings of the controversial decree - which stripped the judiciary of any right to challenge his decisions - will stand.

The general prosecutor, who was dismissed, will not be reinstated, and the retrial of former regime officials will go ahead.

Petrol bombs were thrown and shots fired at opposition demonstrators camping in Tahrir Square in the early hours of Tuesday.

Ten people were injured, the Al-Misri al-Yawm newspaper reported.

Pro-Morsi demonstrators from an umbrella group calling itself the Alliance of Islamist Forces - made of Muslim Brotherhood and Salafist groups - were also said to have gathered at two mosques in Nasser City, a suburb of Cairo.

Hundreds of Islamist demonstrators staged a sit-in outside a Cairo media complex that hosts the studios of several private TV channels, which pro-Morsi protesters accuse of bias.

Seven people died and hundreds more were wounded in clashes between rival protesters outside the palace last Wednesday night.

The police, seen as a weakened force since the fall of ex-President Hosni Mubarak, failed to intervene when anti-Muslim Brotherhood protesters ransacked the Islamist movement's Cairo headquarters last week.

By pressing ahead with a referendum on the constitution, the president says he is trying to safeguard the revolution that overthrew the former president last year.

However, critics calling for large turnouts at Tuesday's protest accuse him of acting like a dictator.

The opposition National Salvation Front has said it will not recognise the draft constitution, as it was drafted by an assembly dominated by Mr Morsi's Islamist allies.

Meanwhile, Mohamed Soudan, foreign relations secretary of the Muslim Brotherhood's Freedom and Justice Party, said Mr Morsi was constitutionally bound to go ahead with Saturday's vote because the date had been announced by the constituent assembly.