The supporters of Egypt’s ousted president have dug in at their two Cairo sit-ins after security officials said police would besiege the entrenched protest camps within 24 hours perhaps as early as Monday morning.

The development sets the stage for a possible confrontation between the military-backed government and the thousands gathered at the protest sites in support of ex-President Mohamed Morsy.

The protesters have said they will not leave until Mr. Morsy, ousted in a popularly supported coup on July 3, is reinstated.

Weeks of efforts by the international community to end the standoff and find a peaceful resolution have so far failed. Egypt’s interim prime minister warned just ahead of the Muslim Eid-ul-Fitr holiday that ended Sunday that the government’s decision to clear the sit-ins was “irreversible.”

Egypt’s new leadership says the protests have frightened residents of Cairo, sparked deadly violence and disrupted traffic. Leaders of the sit-in say they have been peaceful and blame security forces and “thugs” for violence. More than 250 people have killed in violence since Mr. Morsy’s ouster.

At the main Cairo sit-in, vendors said they have sold hundreds of gas masks, goggles and gloves to protesters readying for police tear gas. Three waist-high barriers of concrete and wood have been built against armoured vehicles.

The security officials said they would set up cordons around the protest sites to bar anyone from entering, and one of the officials said that could begin as soon as sunrise.

But by dawn Monday, there was no indication of any troops moving and the government has not confirmed when forces would advance on the sit-ins.

The Interior Ministry has said it would take gradual measures, issuing warnings in recent weeks and saying it would use water cannons and tear gas to minimize casualties.

Interior Ministry officials, speaking to The Associated Press on condition of anonymity because they are not authorized to discuss details of the security plans, said they are prepared for clashes that might be set off by the cordons. The officials said police are working with the Health Ministry to ensure ambulances are on hand for the wounded and that armoured police vans are nearby to take away those arrested.

A special force within the riot police trained for crowd dispersal is expected to deal with protesters. In the past, however, Egypt’s riot police, many lacking the training to deal with unarmed civilians, have resorted to using lethal force.

Mass rallies two weeks ago called by Egypt’s military leader, Gen. Abdel-Fattah el-Sissi, showed that a large segment of Egypt’s population backs the armed forces’ actions against Mr. Morsy’s supporters.

Just before the holiday, the government said international efforts failed to reach a diplomatic solution to the standoff with Mr. Morsy’s supporters, who include members of his Muslim Brotherhood. A last-ditch effort was launched over the weekend by the Sunni Muslim world’s pre-eminent religious institution, Al-Azhar, to push for a resolution.

There are fears that violence from police trying to clear the two sites will spread to other areas of the capital and beyond, where thousands of Morsy supporters also hold near-daily marches.

The main protest camp in Cairo is between middle-class residential buildings and ground floor businesses. Its focal point is a mosque and an adjacent stage where Brotherhood leaders charged with inciting violence openly talk to journalists.

Among them is former lawmaker Mohammed el-Beltagy, who vowed over the weekend to continue protesting at the sit-ins.

“We will happily sacrifice our souls, not for ourselves but to free the captured nation and to ensure freedom and dignity to our people and to the coming generations,” he said.

Security officials, speaking anonymously because they are not authorized to release the information, suspect Brotherhood guards around the mosque in Rabaah al-Adawiya Square are well-armed. They also say both camps have armed protesters on rooftops ready to shoot.

The Interior Ministry has depicted the encampments as a public danger, saying 11 bodies bearing signs of torture were found near both sites.

Amnesty International has also reported that anti-Morsy protesters have been captured, beaten, subjected to electric shocks or stabbed. At least eight bodies have arrived at a morgue in Cairo bearing signs of torture, the human rights group said.

Of the more than 250 people killed since Mr. Morsy’s ouster, at least 130 were his supporters who died in two clashes with security forces last month.

At the Cairo sit-ins, the overwhelming majority echo the demands of the Muslim Brotherhood, Restore Mr. Morsy to power and reverse all the actions taken by the military, including suspension of the disputed constitution and disbanding of the legislature.

Many of those interviewed dismissed the mass protests against Mr. Morsy in the final weekend of June that preceded the military coup. They acknowledge that Egypt is sharply divided, but worry that if they do not defend the sit-ins, they will be detained and tortured just as many were before the 2011 uprising that toppled autocrat Hosni Mubarak.

They say they waited for hours to vote for Mr. Morsy in the elections that catapulted his Brotherhood to power after years of oppression and that the military leaders have now stolen their children’s future by overturning the outcomes of the balloting.

Um Roqiya said she will remain camped out with her five children, despite concerns for their safety.

“We are here to defend legitimacy. If I die defending that, we are martyrs,” she said while patting her 7-year-old son on the head.

Organizations like UNICEF have condemned what it calls the deliberate use of children in Egypt who are “put at risk as potential witnesses to or victims of violence.” The Brotherhood says it cannot control families that choose to camp out.

Neither authorities nor the guards have made clear how women and children will be able to safely leave if rocks start flying and tear gas is fired. In past clashes, birdshot and live bullets were allegedly used by both sides.

Saber Mohammed Mansour, who is from Egypt’s Sinai Peninsula, has spent 44 days as a guard at the main camp. Dressed in a traditional “galabiya,” a long loose garment, Mr. Mansour said he is willing to die for the cause.

Mr. Mansour and his fellow civilian guards, who wear hardhats and stand behind the sandbags, say their only weapons are the sticks they wield.

For Mr. Morsy supporters, the sit-ins are one of the last ways to express themselves against the new government. The TV channels sympathetic to Mr. Morsy were shut down after they appeared to incite violence. Mr. Morsy and top leaders of the Brotherhood have been detained and are facing criminal investigations.

More In: World | International | News