BEIRUT, Lebanon — He had long been one of the more optimistic anti-government residents of the besieged, rebel-held section of Aleppo, trying to buoy others’ spirits even as loyalist forces closed in. But as the Syrian Army and allied militias took more and more territory in an apparently decisive offensive during the week, Yasser Hmeish, an accountant for the local medical council, grew frantic.

Soldiers seized his neighborhood on Wednesday while he worked at a clinic blocks away. Several of Mr. Hmeish’s neighbors were brought into the clinic wounded, but died before he could ask what had happened to his family.

“I don’t know anything, anything about them,” Mr. Hmeish said in an audio message, in one of scores of exchanges we had with people inside east Aleppo as the offensive unfolded. “We are about to die or be arrested.”

After years of bombing and months under siege, rebels had lost more than three-quarters of their territory in eastern Aleppo by the end of the week, throwing thousands of civilians and fighters into chaos. We followed the events in real time from Beirut, monitoring social media and talking via WhatsApp, Skype, telephone and other media with doctors, fighters, housewives, local council members, antigovernment activists, aid workers and others, including on the government side. All were people we had gotten to know through years of covering Syria’s bloody civil war.

They confided their dilemmas over whether to flee to government-held areas or stay put until the bitter end, a choice that split up many families. They described escalating bombardment and attacks that have killed women and children trying to reach safe ground. They revealed deepening rifts among rebel groups, and between fighters and civilians, over whether and how to surrender.

Some told us of men who, upon reaching government territory, were pulled aside and detained — in a country where torture is common — or sent to fight in the Army. Some said rebel fighters were stopping people from leaving, while others said insurgents were helping them cross front lines. Many simply begged us for help.

“This is our last S O S,” said Mohammad al-Ahmad, a radiology nurse whose hospital was taken over by government forces. He sent us text messages from a makeshift basement clinic where, he said, only first aid is available and serious injuries mean death.

“I saw doctors standing in front of victims crying,” he said.

As a turning point in the war approaches, countries like the United States, which have long demanded that President Bashar al-Assad step down, are reduced to wrangling with Russia, Mr. Assad’s main backer, over how to protect or evacuate the civilians — no one is sure how many — trapped in the shrinking enclave.

Last month, proposed evacuation deals fell through and government forces began an all-out aerial and ground attack. At least 40,000 people have fled to government areas during the offensive, but some have been unable to, and others have fled deeper into rebel territory, fearing arrest on the other side. Now, Russia has declared that anyone who does not leave will be considered a terrorist and “destroyed.”

The end game is starkly testing the competing narratives at the heart of the conflict in Aleppo. Many on the eastern, rebel-held side say that they have stayed so long because they reject and fear the government and that its indiscriminate attacks are punishment for dissent. Government officials and supporters say the offensive is liberating residents held hostage by the insurgents, who indiscriminately shell government districts.

Many people — estimates range from Russia’s tens of thousands to the United Nations’ 250,000 — stayed for years when they could have left. They built underground schools, hospitals and playgrounds; distributed food; and organized a local council of rebels and civilians.

But as the government advanced this past week, all semblance of order was shattered. Even some die-hard supporters of the rebellion fled, including hundreds of fighters. Three local council members crossed to government territory and were denounced by colleagues as traitors, only to be arrested, with pro-government websites trumpeting the capture of members of a “terrorist council.”

One woman said that she and 30 relatives had left their homes in the Qaterji neighborhood, but that one of her sons, a fighter, had stayed behind. She spoke on the condition that she be identified only by her nickname, Umm Faisal, out of concern for her safety.

Local rebels, Umm Faisal said by phone, guided the group to avoid snipers. At the front line, shelling erupted.

“We started running,” she recalled. “People left their luggage on the ground, holding children’s hands and running. Some were killed and wounded.”

They made contact with government soldiers, who led hundreds of people on foot through holes in walls, over sand and barrels and rubble.

On the way, Umm Faisal said, she saw soldiers loading trucks with goods looted from houses, who smiled and greeted the travelers: “Thank God for your safety.”

At a reception center in the Jibreen district, Umm Faisal and her family received blankets, bread and medicine while the authorities took their identification. Men — whether dutifully or sincerely — chanted for Mr. Assad and the army. Still, she said, many of them were detained, and six of her relatives, men in their 20s, 30s and 40s, were held for Army service.

Later, Umm Faisal said, she, her husband and two children took a taxi to the rebel-held town of Marea, near the Turkish border. Along the twisting route, they bribed guards at checkpoints and talked their way out of detention by Kurdish militias.

Before she left the refugee center, Umm Faisal refused to appear on state television, she said, because “I couldn’t lie on TV.”

Others, though, have been filmed thanking Mr. Assad, receiving aid bags marked “Help from Russia” and saying rebels had earlier prevented them from leaving.

One aid worker, who spoke on the condition of anonymity for fear of repercussions, said it was unclear how freely civilians in government territory were speaking. But the worker said one man had told her in compelling detail that the rebels refused to let him leave for medical treatment for his young daughter, who was rail thin from a stomach ailment.

Separately, a nurse in eastern Aleppo, who spoke on the condition that she not be named, told us that rebels had stopped her parents and others from leaving the Bustan al-Qasr neighborhood. First, the fighters warned their group that government troops would shoot them, the nurse said. Then they threatened the travelers, asking why they wanted to “go to those who are bombing you.”

“We are dead either way,” one civilian had replied, the nurse said.

Aid workers say the reclaimed areas of east Aleppo are largely destroyed and empty: Very few people stayed as troops moved in.

The army took several hundred people back to one district, Hanano, telling them to move into abandoned apartments. But with no electricity, heat or water and many homes looted, some have asked to return to shelters despite the cold, uncomfortable conditions there as aid agencies scramble to catch up.

Those who have decided to stay inside eastern Aleppo face continued airstrikes and shelling as people crowd into shrinking areas without medical care.

Modar Shekho, a nurse, and his family ran from their house under fire, several of his friends said. As they searched for shelter, a shell killed his brother. As they looked for a place to bury him, the friends said, another explosion killed his father, a teacher who had helped arrange for students to take their state exams despite the siege.

It was the second time that Mr. Shekho had lost two members of his family in a single day, according to friends; a brother and sister, a doctor and nurse, died in a hospital bombing in 2013.

Given such suffering, rebel groups are arguing. A hard-line minority, including the Qaeda-linked Levant Conquest Front, wants to continue the fight, and the rest, including United States-backed groups, want to make a deal to get civilians out. Some question whether they have already waited too long.

Zohair al-Shimali, a longtime activist, said he and others who had led street protests and later supported rebels had failed to deliver.

“People started to hate their lives because of us,” he wrote in a text message. “Everything we’ve done is for nothing, we lost everything.”

He said that while some rebels were counseling “patience,” he was ready for any deal, either for rebels to leave in exchange for ending the bombing or to bus civilians out.

“People have the right to take their children wherever they want, we can’t take them as hostages,” he said. “We couldn’t meet the promises we made them.”

Infighting and mistrust among rebels have hastened their collapse. During the week, Qaeda-linked fighters attacked United States-backed groups and took their supplies.

Dr. Farida, a gynecologist who spoke on the condition that her last name not be used, checked off the people around her who planned to leave.

“My only neighbor, my only aunt and uncle, my secretary, my maid, and even my right hand at work are going to the regime areas,” she wrote in a text message. “They are neutral and just want to live and eat and drink, they don’t care about the revolution and religion.

“I feel like I lost a piece of me,” she wrote. “I can’t stop crying.”