Every few minutes, a deafening boom. Then a whistle of artillery. Occasionally, the clatter of a pickup truck, piled with soldiers, advancing to the front line.

This was the neighborhood, on the western edge of Raqqa, the Islamic State’s de facto capital, where I met Hassan Hashem Ramadan on a scorching Thursday in late August.

He had been detained and flogged three times while the Islamic State ruled his city: Either his beard was too short or his pants weren’t short enough. When he tried to escape across the Euphrates River, he was marched at gunpoint into the city center. Finally, on a Tuesday morning in August, his brother was hit by shrapnel from forces fighting the Islamic State.

Mr. Ramadan carried him in his arms, first to the hospital, then to the grave. Then he fled.