Strained relations between Egyptian activists and the country's military rulers appeared close to breaking point on Sunday after dozens of protesters were attacked by assailants during a rally in Cairo at the weekend.

The march on Saturday evening began with a two-week sit-in in Tahrir Square, the iconic heart of the revolution, and was heading towards Cairo's defence ministry when it came under attack by armed baltagiya – Arabic for thugs. The unidentified assailants appeared to be sympathetic to the ruling generals, who were a pillar of the old regime.

Thousands of placard-wielding and chanting protesters, who had approached the ministry of defence in the Abbasyia district, were blocked en route by tanks and hundreds of soldiers stationed behind a makeshift barrier of metal frames and barbed wire. They found themselves trapped and were set upon by armed thugs wielding swords, knives and hurling rocks and molotov cocktails.

Among the protesters was Hossam El-Hamalawy, a prominent activist, who later wrote on his blog: "We stood our ground, demanding we pass. We were refused. The attack started. Young men carrying swords and knives flocked to our right, while others were stoning us from the side streets. Soldiers kept firing their machine guns into the air, to be followed later by a chopper circulating around our heads. It was a war zone in every sense of the word."

Dozens were injured in the chaos, as they were showered by rocks hurled from rooftops, while others were hurt in the ensuing stampede. The injured, estimated to run into hundreds, were ferried to nearby hospitals. It was reported that at least one journalist was attacked.

Among those detained was a prominent Egyptian blogger and human rights researcher, Amr Gharbeia, who was seized by unidentified men as he attempted to leave the scene of the protest. He was incommunicado for several hours, prompting frantic calls for information on his whereabouts and international demands for his release, including from Amnesty International, his former employer. "I am home, safe and resting. Grateful for everybody," he later wrote on Twitter.

The violence in Abbasyia marked a significant escalation in tensions between activists, who have been at the vanguard of the revolution, and Egypt's military rulers, known as the Supreme Council of the Armed Forces, who assumed control of the country on 11 February. While the military has denied any involvement in Saturday's violence the protesters have accused them of at least being complicit as they did not intervene to protect them from the attacks.

A wall of distrust has been building for several weeks as activists have complained that conservative elements, including the military, were betraying their push for freedom and democracy by shielding members of the former regime.

Angered by the lack of progress, protesters reoccupied and erected tents in Tahrir Square on 8 July to pressure the military into bringing those accused of killing protesters during the 18-day uprising to trial and to persuade interim rulers to stick to their pledges of bringing social justice, civil liberties and democracy.

Activists want them to move faster in bringing former regime officials to justice and set a date for the transition to civilian rule. The military accuse activists of treason, warning protesters against "harming national interests" and calling on "honourable" Egyptians to confront actions that disrupt a return to normal life.

As news of the bloody clashes in Abbaysia was relayed back to Tahrir Square on Saturday night, young activists gathered to discuss whether they too might be targeted by military or armed thugs there. Ahmed, a young man who had camped in the square from the earliest days of the revolution, took a microphone and told the crowd to stand strong. "Tonight we may die here," he bellowed, as some in the audience applauded. "If you are ready to die then stay. If not, then go home."

As the night wore on the injured from Abbasiya returned to the square to receive treatment as fears of an assault dissipated. Many in the camp felt it was a matter of time before another showdown with the military, who they believe will attempt to clear the square of protesters. "The military are just another face of the old regime," said one demonstrator.