Egypt’s military ruler said presidential polls will be held by the end of June, and offered a referendum on the immediate transfer of power in a bid to defuse tensions after days of deadly anti-military rallies.

Field Marshal Hussein Tantawi, who took power when Hosni Mubarak was ousted in February, said in a televised address he had accepted the cabinet’s resignation, a week before crucial legislative polls which he said would be held on schedule.

The ruling Supreme Council of the Armed Forces (SCAF) “does not aspire to hold power and is fully willing to transfer responsibility immediately should the people wish it, through a popular referendum if necessary,” Tantawi said.

He said the council had accepted the resignation of Prime Minister Essam Sharaf’s cabinet and had “tasked it to carry on working until a new government is formed… to handle the transition in cooperation with the Supreme Council.”

Tantawi said his council was also committed to holding parliamentary elections on schedule on November 28 and to “electing a president of the republic by the end of June 2012.”

As news of the statement filtered into Cairo’s Tahrir Square, where tens of thousands attended an anti-military rally, protesters railed against Tantawi.

“The people want the downfall of the field marshal,” they chanted, just blocks away from clashes near the interior ministry on the outskirts of the square.

“We can’t trust what he says. The ball has been in SCAF’s court for months, and they didn’t do anything,” said Ibtisam al-Hamalawy, 50.

“Tantawi is Mubarak, copy pasted. He’s Mubarak in a military uniform,” said Ahmed Mamduh, an accountant.

Tuesday’s rally came after days of deadly clashes pitting police against protesters demanding democratic change.

The confrontations continued into the night, with police using batons, tear gas and birdshot against demonstrators in streets leading to the nearby ministry of the interior.

Dozens of protesters linked arms to form a corrider as ambulances and men on motorbikes frantically sped back and forth carrying the wounded, as the stinging tear gas wafted into the main square.

“Leave!” the huge crowd urged Tantawi from the iconic central plaza, where 10 months ago the same call toppled his long-time boss Mubarak.

“Say it, don’t be scared: The military must go!” they chanted.

Overnight, protesters severely beat and stripped a man they claimed was a member of the dissolved State Security apparatus, witnesses said.

The protesters alleged the man, who was taken to hospital severely injured, was carrying a firearm. A security official denied that the man belonged to the interior ministery.

The SCAF had invited the country’s political forces for crisis talks amid spiralling unrest that threatened to derail the election.

The Muslim Brotherhood, Egypt’s best-organised political force, joined the talks, which also included presidential hopeful and former Arab League chief Amr Mussa and the head of the liberal Wafd party Sayyed Badawi.

Protests also erupted in the Mediterranean city of Alexandria, the canal city of Suez and the central city of Qena, the northern city of Port Said and Assiut and Aswan in the south, as well as in the Nile Delta province of Daqahliya and the Red Sea resort of Sharm el-Sheikh.

Protesters at Tahrir Square indicated they wanted to hear nothing less than an announcement of an end to military rule.

Since Mubarak’s ouster, protesters have grown increasingly angry at the military council which they accuse of being an extension of the old regime and of resorting to Mubarak-era tactics to stifle dissent.

According to the health ministry, at least 30 people have been killed since Saturday, when the security forces first resorted to tear gas, rubber bullets and birdshot in an bid to scatter protesters.

Demonstrators responded with stones and petrol bombs.

Possible presidential candidate Mohamed ElBaradei accused the security forces of carrying out a “massacre.”

“Tear gas with nerve agent and live ammunition being used against civilians in Tahrir,” the ex-UN nuclear watchdog chief said in a message posted on Twitter. “A massacre is taking place.”

The United States said it was “deeply concerned” by the violence and called for democratic elections, as watchdog Amnesty International charged the SCAF’s record on human rights was worse than under Mubarak.

Egypt’s main stock market index closed down 4.77 percent after trading on the bourse had been suspended for one hour when the main EGX-30 index fell 172.82 points to 3,688.17 points, according to the Egyptian Exchange website.

Egypt’s military-appointed cabinet of civilian officials announced its resignation late on Monday.

The SCAF said it had asked the justice ministry to set up a committee to probe the violence, and called on “all forces and citizens to commit to (restoring) calm, and creating an atmosphere of stability with the goal of pursuing the political process.”

The Brotherhood-affiliated Freedom and Justice Party had said it would not join Tuesday’s protest over its “desire not to pull people towards fresh bloody confrontations with the parties that are seeking more tension.”

Tuesday’s rally was called by the activist groups which spearheaded the popular uprising that forced Mubarak out.

In a Facebook page for the rally, the groups called for the immediate resignation of Sharaf’s cabinet and the formation of a “national salvation” government.

They also demanded a presidential election by April 2012 and a complete overhaul of the interior ministry.

Several politicians, including ElBaradei, have urged the military to review its plans for the transfer of power to civilians, by organising a presidential election before the parliamentary polls which are due to begin next Monday and last several months.

The Muslim Brotherhood, although highly critical of the military rulers, opposes any postponement of the legislative vote, feeling it is in a strong position.

The military is also under international pressure to halt the violence, including from the United States.

“We condemn the excess of force used by the police and we strongly urge the Egyptian government to exercise maximum restraint, to discipline its forces and to protect the universal rights of all Egyptians to peacefully express themselves,” State Department spokeswoman Victoria Nuland said.

UN leader Ban Ki-moon urged the military council to “guarantee” civil liberties and deplored the deaths in the clashes.