CAIRO — Reaching the heavily sandbagged entrance to the sprawling protest camp in the northeast of this city requires navigating past makeshift brick walls and stepping around circles of stone marking the places where “martyrs” shot by the government fell dead.

Once there, visitors must submit to ID checks and pat-downs by bearded men with orange vests, hard hats and clubs. Signs on a towering new tent read “Children against the coup.”

And then, stretching into the distance is the camp, where tens of thousands of people have built what amounts to a well-equipped community in what was once a traffic-clogged intersection. There are tents with electricity, televisions and Internet access, some of them two stories tall. There are a hospital, communal kitchens, latrines and showers.

This and a smaller camp across town are the front lines in Egypt’s dangerous political stalemate between a military-installed government and the Muslim Brotherhood and its Islamist allies who support the ousted president, Mohamed Morsi. The new government accuses them of gathering weapons and says they must leave or it will evict them by force.