The citizens of Kabul were given reassurances that they would be safe, that a deal had been struck to avoid a full-fledged attack by the Taliban on their city. But for many Afghans, the scenes playing out around them on Sunday in their capital told another story.

It was not just that their president had fled the country. There were innumerable smaller signs that their world was about to change.

Police posts had been abandoned, and the officers had shed their uniforms in favor of civilian garb. Posters of women at beauty salons were painted over — presumably to avoid retribution from Afghanistan’s new, fundamentalist rulers. And on the east side of the city, inmates at Kabul’s main prison, many of them members of the Taliban, seized the opportunity to break out.

“This is the Day of Judgment,” declared an onlooker as he filmed the inmates carrying bundles of belongings away from the prison.

The Afghan interior minister, Abdul Sattar Mirzakwal, announced in the early afternoon that an agreement had been made for a peaceful transfer of power for greater Kabul.

“We have ordered all Afghan National Security Forces divisions and members to stabilize Kabul,” Mr. Mirzakwal said in a video statement. “There will be no attack on the city. The agreement for greater Kabul city is that under an interim administration, God willing, power will be transferred.”

But residents seemed unconvinced by their leaders’ assurances.

Many had fled to Kabul as their own cities fell. Kabul, if nowhere else in their country, seemed that it might provide a haven for at least the near future.

But the future was nearer than almost anyone knew, and on Sunday, with the Taliban in Kabul, many people — among them President Ashraf Ghani and other senior government officials — were looking for an exit from the country itself.

Afghans and non-Afghans alike headed to the airport, where the scene was one of chaos. Witnesses at the civilian domestic terminal said thousands of Afghans had crammed into the terminal and swarmed around planes on the tarmac, desperately seeking flights out.

The United States Embassy warned Americans not to even try.

“The security situation in Kabul is changing quickly including at the airport,” the embassy said in a statement. “There are reports of the airport taking fire; therefore we are instructing U.S. citizens to shelter in place.”

With the evacuation of U.S. diplomats and some civilians underway on Sunday, helicopter after helicopter could be seen ferrying passengers to Kabul’s airport. But many Afghans could do little more than look on in despair.

The Taliban themselves appeared to be trying to strike a tone of reassurance.

“Our forces are entering Kabul city with all caution,” the militants said in a statement.

But as the sun set behind the mountains, the traffic was clogged up as crowds grew bigger. More and more Taliban fighters appeared on motorbikes, police pickups and even a Humvee that once belonged to the Afghan security forces.

With rumors rife and reliable information hard to come by, the streets were filled with scenes of panic and desperation. Some posted videos of the chaos.

Sahraa Karimi, the head of Afghan Film, filmed her own attempt to flee her neighborhood and posted it on Facebook. The video shows her fleeing on foot, out of breath and clutching at her head scarf as she urges those around her to get out while they can.

“Greetings,” she can be heard saying. “The Taliban have reached the city. We are escaping.”