As Taliban fighters took Kabul on Sunday evening, roaming through the halls of the abandoned presidential palace, the group issued a statement: It would soon revive Afghanistan’s former name.

The country that was built in the wake of the 2001 U.S. invasion at a cost of over $2 trillion would revert to the “Islamic Emirate of Afghanistan.”

That’s the name the country bore between 1996 and 2001 — the period that now serves as the only point of reference for what Afghans and the international community can expect from the new government in Kabul. How will thousands of insurgents, who spent the last two decades fighting a guerrilla war, administer the state?

The last time the Taliban ruled Afghanistan, the regime concentrated power within a tight circle of former rebels who had helped to oust the Soviets in the 1980s. That group had emerged from the country’s civil war of the 1990s, promising a government guided by a strict interpretation of sharia law. Its execution of that vision led to a profoundly violent, repressive and unstable nation that welcomed transnational terrorists and became a global pariah.

The first emirate was launched in 1996, shortly after the Taliban arrived in Kabul. In late September of that year, fighters tortured and killed former president Najibullah and then hanged his body from a traffic post. Within a month, the Taliban dispatched squads of “morality police” from an agency known as the Promotion of Virtue and Elimination of Vice.

Men were forced to grow beards. Women were forced to wear burqas, flowing garments that cover the entire face and body. Schools for girls were shuttered. Women who were unaccompanied in public places could be beaten. Soccer was banned. So was music, aside from religious chants. The Taliban government held public executions in Kabul’s Ghazi Stadium.

The outside world got periodic glimpses into the country (even though taking photos was technically forbidden): There was the video of an Afghan mother forced to kneel in the stadium, shot dead between the goal posts. There were photos of children dying of preventable illnesses in a dilapidated pediatric hospital. Images of the ancient Buddhist statues pulverized by the Taliban because its leaders considered the stone images to be idolatrous. The sea of refugees and displaced people living in makeshift tents across the region.

“What shall we do? Every week, we have two children die,” Gulam Said, a man displaced in an encampment along the Panjshir River, told the New York Times in 1999.

And yet the regime made sporadic attempts to gain international legitimacy. It tried to send a diplomat to the U.N. General Assembly. In October 1996, Taliban leader Mohammad Omar sent a letter to U.S. representatives claiming that “the Taliban think highly of the U.S., appreciate U.S. help during the jihad against the Soviets, and want good relations with the U.S.”

Fazelminallah Qazizai, an Afghan freelance journalist, watched as armed Taliban fighters rode through the streets of Kabul for the first time in 20 years. (Jon Gerberg/The Washington Post)

The emirate attempted to replicate the veneer of a modern state. There were ministers of health and commerce, for example. There was a central bank governor. But many of those officials were former military commanders with madrassa, Islamic school, educations.

Back then — as now — the international community had to decide whether and how to engage with a regime it considered morally reprehensible that was nonetheless leading a country desperately in need of international assistance. In 1998, United Nations envoy Lakhdar Brahimi met with Mohammad Omar to talk about humanitarian access.

“We had a real conversation for three hours, though we were sitting on the floor the whole time,” Brahimi later recalled.

But as the depth of the Taliban’s human rights abuses became increasingly clear, diplomatic efforts mostly dissipated. Omar rarely left Kandahar; he communicated mostly by messenger. His militias burned entire villages and targeted Afghanistan’s Shiite minority in brutal military campaigns.

“While making and explaining his decisions, he sometimes mentioned his dreams,” Steve Coll wrote in a 2012 New Yorker article about Omar.

The fractured, chaotic environment that had enabled the Taliban’s rise also made it difficult to govern.

“The problems the Taliban faced while trying to institute a functioning government and state were the same that many aspiring administrations had encountered before: establishing both authority over a fiercely independent population and a monopoly of violence within the country’s sovereign borders,” Felix Kuehn wrote in “Taliban History of War and Peace in Afghanistan.”

When Omar’s Kandahar house was destroyed in a bomb blast, it was Osama bin Laden who helped fund his new palace.

By 1998, Bin Laden had begun offering interviews to foreign media from his tented compound in southern Afghanistan.

After Bin Laden was accused of attacking U.S. embassies in Nairobi and Dar es Salaam in 1998, the Clinton administration fired cruse missiles at Afghanistan. The next year, it sanctioned the Taliban regime.

In 2000, the Taliban, once again seeking international aid, rescinded an edict preventing women from working for international relief agencies. But the terrorist attacks of Sept. 11, 2001, quickly led to the Taliban’s ouster from government.

Eventually, the group reconfigured itself as a powerful insurgency, installing “shadow governors” across the country to oppose the new, U.S.-backed Afghan government. But in recent years, as the group’s return to power came to seem inevitable, analysts began to ask what a new Taliban regime might look like.

“The post-2001 Taliban have proved to be a learning, more political organization that is more open to the influence of external factors,” Thomas Ruttig wrote in a paper for the Combating Terrorism Center at West Point.

Others pointed to the more global outlook of today’s members of the Taliban.

“Many Taliban leaders have now spent over a decade in Pakistan or the Gulf, which has greatly broadened their horizons from their parochial upbringings in southern Afghanistan,” wrote Borhan Osman and Anand Gopal in 2016 in “Taliban Views on a Future State.”

But Sunday, as Afghans watched the Taliban march into the country’s presidential palace in Kabul, they recalled the darkest moments of the last emirate. They rushed to the airport or across the borders — trying to get out of the country before the new regime begins.