CAIRO (AP) — Heavy gunfire rang out Friday throughout Cairo as tens of thousands of Muslim Brotherhood supporters clashed with armed vigilantes in the fiercest street battles to engulf the capital since the country's Arab Spring uprising. At least 37 people were killed in the fighting nationwide, including police officers.

Carrying pistols and assault rifles, residents battled with protesters taking part in what the Brotherhood called the "Day of Rage," ignited by anger at security forces for clearing two sit-in demonstrations Wednesday in clashes that killed more than 600 people.

As military helicopters circled overhead, residents furious with the Brotherhood protesters pelted them with rocks and glass bottles. The two sides also fired on one another, sparking running street battles.

Unlike in past clashes between protesters and police, Friday's clashes took an even darker turn when residents and possibly police in civilian clothing engaged in the violence. There were few police in uniform to be seen as residents fired at one another on a bridge that crosses over Cairo's Zamalek district, an upscale island neighborhood where many foreigners and ambassadors reside.

The Brotherhood-led marches in Cairo headed toward Ramses Square, near the country's main train station. The area is also near Tahrir Square, where the army put up barbed wire and tanks as a buffer between the protesters and a small anti-Brotherhood encampment in the square.

At least 12 people were killed in Ramses Square after protesters clashed with residents in the area, security officials said. Associated Press photographers saw many of the dead inside the nearby Al-Fath mosque, which had turned into a field hospital. Some appeared to have been shot in the head and chest during an attack on a police station.

Across the country, at least 29 civilians were killed in the clashes, along with eight police officers, security officials said. They spoke on condition of anonymity in line with regulations.

Story continues

The violence erupted shortly after midday weekly prayers when tens of thousands of Brotherhood supporters answered the group's call to protest across Egypt in defiance of a military-imposed state of emergency following the bloodshed earlier this week.

Armed civilians manned impromptu checkpoints throughout the capital, banning Brotherhood marches from approaching and frisking anyone wanting to pass through. At one checkpoint, residents barred ambulances and cars carrying wounded from the Ramses Square clashes from reaching a hospital.

The scenes highlighted how deep divisions in Egypt have become. At least eight police stations were attacked Friday, officials said. Egypt's police force was rocked by the country's 2011 uprising that ousted longtime leader Hosni Mubarak from power and has not fully recovered since.

On Thursday, the Interior Ministry said it had authorized the use of deadly force against anyone targeting police and state institutions. But the threat appeared not to intimidate protesters.

Tawfik Dessouki, a Brotherhood supporter, said he was ready to fight for "democracy" and against the military's ouster of Morsi.

"I am here for the blood of the people who died. We didn't have a revolution to go back to a police and military state again and to be killed by the state," he said.

Also Friday, security officials said assailants detonated explosives on train tracks between Alexandria and the western Mediterranean Sea province of Marsa Matrouh. There were no injuries and no trains were damaged from the attack, officials said, speaking on condition of anonymity in line with regulations.

Egypt, the Arab world's most populous nation, has been in turmoil since Morsi was removed from power by the military on July 3, following days of mass protests against him and his Brotherhood group. But Morsi's supporters have remained defiant, demanding the coup be overturned. The international community has urged both sides in Egypt to show restraint and end the turmoil engulfing the nation.

On Wednesday, riot police backed by armored vehicles and bulldozers cleared two sprawling encampments of Morsi supporters, sparking clashes that killed at least 638 people.

The Brotherhood's political wing, the Freedom and Justice Party, said in a statement Friday that the group is not backing down and "will continue to mobilize people to take to the streets without resorting to violence and without vandalism."

"The struggle to overthrow this illegitimate regime is an obligation, an Islamic, national, moral and human obligation which we will not steer away from until justice and freedom prevail, and until repression is conquered," the statement said.

The group said in another statement that its protests were peaceful.

The revolutionary and liberal groups that helped topple Morsi have largely stayed away from street rallies in recent weeks.

Meanwhile, state-run and private television stations have been broadcasting footage from Wednesday's violence they say shows armed men firing toward security forces. Graphic videos have emerged online portraying the violence from the protesters' side.

One video, authenticated by The Associated Press based on landmarks and reporting from Wednesday's crackdown, shows armored personnel carriers driving protesters back from an area near the main sit-in as continuous volleys of automatic gunfire rang out.

In the footage, the crowd was shown retreating after throwing stones at the approaching vehicles, leaving several bloodied men motionless on the ground. After a loudspeaker announcement instructed the crowd to evacuate, promising safe passage, a vehicle approached and the barrel of a weapon emerged from one of its gun ports.

___

Associated Press writer Mariam Rizk contributed to this report.