BEIRUT, Lebanon — The siege in Aleppo is almost over.

Advances by Syrian government forces and their allies have squeezed the fighters and civilians remaining in rebel-held parts of the city into a sliver of territory, spokesmen for the government and the opposition forces said on Monday. The last civilians caught in the shrinking antigovernment enclave issued panicked calls for help.

Late Monday, several residents reported via text and voice messages that they were crowded into abandoned apartments and rainy streets, exposed to shelling and afraid they would be killed or arrested if pro-government forces reached them, as antigovernment activists circulated reports of scores of summary killings in retaken areas.

The United Nations secretary general, Ban Ki-moon, said in a statement on Monday that he was alarmed by reports of atrocities against a large number of civilians, including women and children.

It appeared increasingly likely that the government would gain control of the whole of Aleppo, the largest city in Syria, within days, if not hours. Videos from government-held districts showed people celebrating in the streets, waving flags and honking horns.