[This story has been optimized for offline reading on our apps. For a richer experience, you can find the full version of this story here. An Internet connection is required.]

Syrian Democratic Forces soldiers push past debris in Raqqa, the site of fierce fighting with the Islamic State. (Alice Martins/For The Washington Post)

It took Ahmed Brazu and his family 20 terrifying hours to escape this ravaged city, the capital of the Islamic State’s imagined caliphate that has become an increasingly perilous battlefield.

The U.S.-backed forces closing in on the militant stronghold had urged fleeing civilians to avoid Islamic State positions. But those instructions proved useless; the family hid in a mosque, only to come under fire from the militants’ rocket-propelled grenades. The danger came from the city’s would-be liberators, too: Brazu’s brother and a niece were killed in a U.S.-led coalition airstrike a few days before he fled.

“The bombing was nonstop. We were terrified,” said Brazu, who was sitting in the back of a pickup truck with nearly two dozen relatives, exhausted and covered in dust but clear of the city at last.

Ahmed Brazu, second from front left, sits in the back of a pickup truck with his family after they fled Raqqa. At one point, they had to hide in a mosque. Some civilians are still trapped in the city. (Alice Martins/For The Washington Post)

Under Islamic State control for more than three years, Raqqa has been a symbol of the extremist group’s lofty ambitions, a home to many of its leaders and the site of atrocities — including the murders of journalists — that have helped galvanize the coalition in the fight.

The U.S.-backed forces seized the final route into Raqqa last week as they pushed into the city. Several hundred U.S. Special Operations troops are advising them, and an unknown number of American support personnel — including Marine howitzer gunners and a detachment of troops operating a nearby airfield — are all in the area.

But tens of thousands of civilians are still trapped in the city, and the fighting is expected to be fierce.

I met Brazu and his family after spending the better part of June shuttling back and forth to Raqqa, just as the long-awaited assault began. I was one of two foreign journalists embedded with the U.S.-backed force known as the Syrian Democratic Forces (SDF), a diverse group dominated by Kurdish fighters that is trying to dislodge the militants.

Smoke rises in the wake of an airstrike in a neighborhood in the western part of Raqqa. The city has been controlled by the Islamic State for more than three years. (Alice Martins/For The Washington Post)

Changing hands

I had been to Raqqa before, in 2013, after it was captured by rebel groups opposing the government of Syrian President Bashar al-Assad. At the time, the rebel fighters held up the city as a shining example of what Syria might look like if they prevailed.

The celebratory mood didn’t last.

Over a period of six months that year, the Syrian government carried out random airstrikes and artillery shelling. Most of the victims were civilians.

The rebels took responsibility for the administration of the city, but soon the Islamic State pushed in, occupying the governorate building and raising a large, black flag in the square out front. The more moderate rebel fighters finally challenged the militants, but the battle lasted only three days.

By January 2014, the Islamic State was strong enough to seize control of all of Raqqa. The city became notorious for public executions, including beheadings, and other brutal punishments.

In western Raqqa, Syrian Democratic Forces soldiers take aim at a minaret that they suspect holds an Islamic State sniper. (Alice Martins/For The Washington Post)

A deadly start

Early last month, SDF commanders announced the start of the offensive to capture Raqqa from a base 10 miles outside the city. I could hear booms from intense air bombardment during their news conference and later learned that the force sustained its first casualties that day: two soldiers, killed inside the city by an improvised explosive device.

Later, as the sun set, a Kurdish commander using the nom de guerre Clara Raqqa stood on a rooftop communicating with front-line commanders over a radio and marking their positions on a tablet computer. It was important to update the exact locations of the troops, she said, and pass them on to coalition forces “so they know where we are and don’t target us by mistake.”

Shoes and clothing are strewn outside an abandoned shop in an eastern Raqqa neighborhood. (Alice Martins/For The Washington Post)

The collaboration between the United States and Syrian Kurdish fighters known as the People’s Protection Units (YPG) has been controversial. American commanders have argued that the YPG is the only ground partner capable of carrying out the Raqqa offensive.

But its participation has infuriated Turkey, which neighbors Syria and is a NATO ally of the United States. The YPG is affiliated with the Kurdistan Workers’ Party (PKK), which has fought a long insurgency against the Turkish state. Some of the commanders I met appeared to have a more direct connection to the PKK, speaking with a Turkish accent or else refusing to say where they were from. Often, they did not know the names of the villages or neighborhoods where they were fighting.

A Syrian Democratic Forces soldier listens in on military-radio chatter at his position on the eastern edge of Raqqa. (Alice Martins/For The Washington Post)

Some residents of Raqqa, the Arab-majority province that surrounds the city, are also uneasy, and worried about revenge attacks or ethnic cleansing by the Kurdish force. Abu Maan, a tribal Arab who escaped from his Islamic State-controlled village, had not been able to return in the days since the SDF captured it.

When he asked why, he said, they lied to him, telling him that it was unsafe — when in fact, it appeared to have been turned into a garrison for Kurdish and American soldiers.

“We can smell freedom,” he said. “We cannot taste it yet.”

Improvised bombs used by Syrian Democratic Forces soldiers are piled at a position in the Mishlab district. (Alice Martins/For The Washington Post)

Snipers everywhere

I arrived at an SDF position on the western edge of the city at 8 o’clock one morning and met a commander who gave only his first name, Rezan. He wore an insignia with the face of Abdullah Ocalan, the PKK’s jailed leader, on his right arm.

He sat in a house with two radios and a tablet he used to monitor the battle. He was all but sequestered inside: An Islamic State sniper had been shooting at his position for a whole day, but the soldiers in the area couldn’t pinpoint the sniper’s location.

They were everywhere, the snipers, preventing reinforcements from reaching Rezan’s men, who had been fighting on the front lines on the northwestern edge of the city for six days without a break.

Syrian Democratic Forces soldiers carry supplies to a front-line position in Raqqa. (Alice Martins/For The Washington Post)

I joined a group of his men who were heading to a front-line position on foot, bearing food, supplies and ammunition. We dashed across a street, in sight of a sniper’s nest in a mosque a few blocks away. We walked past houses that appeared to have been destroyed by airstrikes, as well as others crushed by artillery shells. A fresh trail of blood ran along a path marked by rocks to show that the area had been cleared of land mines.

We heard a drone. SDF fighters on a rooftop nearby screamed for us to take cover, but the gates around nearby houses were locked. Finally, the soldiers kicked one open, and we went inside a home. I noticed another trail of blood and larger puddles on the stairs that led to the rooftop.

That morning, a fighter had been killed and five others hurt when an Islamic State drone dropped explosives. The group of men I accompanied were their replacements.

Fresh destruction

Back at the SDF position, Rezan told me they had identified an Islamic State sniper position in a building nearby and called in a coalition airstrike.

Surrounded by rubble, a Syrian Democratic Forces soldier watches over a Raqqa rooftop. (Alice Martins/For The Washington Post)

I asked him if there were civilians in the area. Hundreds of civilians are believed to have been killed in coalition airstrikes in the past few weeks alone, according to monitoring groups. Rezan said most had already fled or were taken by the Islamic State as human shields.

The airstrike hit a building across an open field but not the one with the sniper. So instead, Rezan’s men shelled an entire line of buildings to pave the way for advancing SDF troops. I asked Rezan the name of the neighborhood they were shelling. He said he had no idea, and neither did his men.

A sniper for the People’s Protection Units keeps an eye on Islamic State positions in the eastern part of Raqqa. (Alice Martins/For The Washington Post)

When we finally reached a front line in eastern Raqqa, a young Kurdish sniper sat in a room barely large enough to fit her plastic chair.

For several hours, she sat in the same position, watching a street controlled by Islamic State militants. That morning, she had seen some movement and two cars drive by, but she had yet to take a shot.

“I will sit here all day, every day,” she said. “As long as it takes until they are all gone.”

The view from a Syrian Democratic Forces sniper position between two walls in the eastern part of Raqqa. (Alice Martins/For The Washington Post)

Kareem Fahim in Istanbul contributed to this report.