structural:expansion
Occupations, wars and Taliban rule (1996–2001)

On 28 April 1978, President Daoud and most of his family were assassinated in Kabul's Presidential Palace in what is called the Saur Revolution. Pro-Soviet PDPA under Nur Muhammad Taraki seized power and slowly began to institute reforms. Private businesses were nationalised in the Soviet manner. Education was modified into the Soviet model, with lessons focusing on teaching Russian, Marxism–Leninism and learning of other countries belonging to the Soviet bloc.

Amid growing internal chaos and heightened cold war tensions, the U.S. Ambassador to Afghanistan, Adolph Dubs, was kidnapped on his way to work at the U.S. Embassy in Kabul on 14 February 1979 and killed during a rescue attempt at the Serena Hotel. There were conflicting reports of who abducted Dubs and what demands were made for his release. Several senior Soviet officials were in the lobby of the hotel during a standoff with the kidnappers, who were holding Dubs in room 117. Afghan police, acting on the advice of Soviet advisors and over the objections of U.S. officials, launched a rescue attempt, during which Dubs was shot in the head from a distance of six inches and killed. Many questions about the killing remain unanswered.

On 24 December 1979, the Soviet Union invaded Afghanistan and Kabul was heavily occupied by Soviet Armed Forces. In Pakistan, Director-General of the ISI Akhtar Abdur Rahman advocated for the idea of covert operation in Afghanistan by arming Islamic extremists who formed the mujahideen. General Rahman was heard loudly saying: " Kabul must burn! Kabul must burn! ", and mastered the idea of proxy war in Afghanistan. Pakistani President Zia-ul-Haq authorised this operation under General Rahman, which was later merged with Operation Cyclone, a programme funded by the United States and carried out by the Central Intelligence Agency.

The Soviets turned the city of Kabul into their command centre during the Soviet–Afghan War, and while fighting was mostly taking place in the countryside, Kabul was widely disturbed. Political crime and guerrilla attacks on military and government targets were common, and the sound of gunfire became commonplace at night in the outskirts. Large numbers of PDPA party members and Soviet troops were kidnapped or assassinated, sometimes in broad daylight, with acts of terrorism committed by civilians, anti-regime militias and also Khalqists. By July 1980, as many as twelve party members were being assassinated on a daily basis, and the Soviet Army stopped patrolling the city in January 1981. A major uprising against the Soviet presence broke out in Kabul in February 1980 in what is called the 3 Hut uprising. It led to a night curfew in the city that would remain in place for seven years. The Soviet Embassy also, was attacked four times with arms fire in the first five years of the war. A Western correspondent revisiting Kabul in December 1983 after a year, said that the city was "converted into a fortress bristling with weapons". Contrastingly, that same year American diplomat Charles Dunbar commented that the Soviet troops' presence was "surprisingly modest", and an author in a 1983 Bulletin of the Atomic Scientists article thought that the Soviet soldiers had a "friendly" atmosphere.

The city's population increased from around 500,000 in 1978 to 1.5 million in 1988. The large influx were mostly internal refugees who fled other parts of the country for safety in Kabul. During this time, women made up 40% of the workforce. Soviet men and women were very common in the city's shopping roads, with the large availability of Western products. Most Soviet civilians (numbering between 8,000 and 10,000) lived in the northeastern Soviet-style Mikrorayon (microraion) housing complex that was surrounded by barbed-wire and armed tanks. They sometimes received abuse from anti-Soviet civilians on the streets. The mujahideen rebels managed to strike at the city a few times—on 9 October 1987, a car bomb planted by a mujahideen group killed 27 people, and on 27 April 1988, in celebrations of the 10th anniversary of the Saur Revolution, a truck bomb killed six people.

After the fall of Mohammad Najibullah 's government in April 1992, different mujahideen factions entered the city and formed a government under the Peshawar Accords, but Gulbuddin Hekmatyar 's party refused to sign the accords and started shelling the city for power, which soon escalated into a full-scale conflict. This marked the start of a dark period of the city: at least 30,000 civilians were killed in a period known locally as the "Kabul Wars." About 80 percent of the city was devastated and destroyed by 1996. The old city and western areas were among the worst-hit. A New York Times analyst said in 1996 that the city was more devastated than Sarajevo, which was similarly damaged during the Bosnian War at the time.

The city suffered heavily under a bombardment campaign between rival militias which intensified during the summer of 1992. Its geographic location in a narrow valley made it an easy target from rockets fired by militias who based themselves in the surrounding mountains. Within two years' time, the majority of infrastructure was destroyed, a massive exodus of the population left to the countryside or abroad, and electricity and water was completely out. In late 1994, bombardment of the capital came to a temporary halt. These forces took steps to restore law and order. Courts started to work again, convicting individuals inside government troops who had committed crimes. On 27 September 1996, the hardline Taliban militia seized Kabul and established the Islamic Emirate of Afghanistan. They imposed a strict form of Sharia (Islamic law), restricting women from work and education, conducting amputations against common thieves, and hit-squads from the infamous "Ministry for Promotion of Virtue and Prevention of Vice" watching public beatings of people.