A gun battle erupted outside the Cairo headquarters of the Republican Guard on Friday, killing at least three supporters of ousted Egyptian president Mohamed Morsi and wounding many more, an AFP correspondent said.

The bodies of two people were covered with sheets, said the correspondent, adding that another protester had been shot in the head and fell to the ground, parts of his brain spilling from his skull.

Shooting could be heard coming from both the Republican Guard and the ranks of the protesters.

Thousands of demonstrators had marched from the Rabaa al-Adawiya mosque in the nearby neighbourhood of Nasr City, where they had been camping out for days vowing to defend Morsi's legitimacy.

"The Republican Guard are traitors!" they chanted, and "Morsi is our president!"

The shooting broke out when one Morsi supporter tried to hang a picture of the ousted leader on barbed wire attached to the front of the headquarters, said the AFP correspondent.

He was warned twice by members of the Republican Guard not to approach the building before they started shooting.

Gunfire could then be heard coming from the protesters' side.

Morsi, who has not been seen since the military deposed him on Wednesday, had issued a defiant call for supporters to protect his elected "legitimacy", in a recorded speech aired hours after he was toppled.

The military had said it supports the right to peaceful protest, but warned against violence and acts of civil disobedience such as blocking roads.