He joined the Parcham faction of the communist People's Democratic Party of Afghanistan (PDPA) in 1965. Despite being regarded as an intelligent man, he was referred to as Najib-e Gaw (the Bull) by his opponents due to his physique. The PDPA staged a successful coup in 1978, but the Khalq faction of the PDPA gained supremacy, and after a brief stint as ambassador in Tehran, Najibullah was dismissed from government and went into exile in Europe.
He returned to Kabul after the Soviet invasion in 1979. In 1980, he was appointed the head of KHAD, the secret police. Under Najibullah's control, it is claimed that KHAD arrested, tortured and executed tens of thousands of Afghans. Najibullah replaced Babrak Karmal as Afghanistan's President in 1986.
After the Soviet withdrawal in 1989, he withstood a coup headed by his defence minister in 1990 and relaxed his autocratic control to gain support. But by 1992 Najibullah agreed to step down in favor of a transitional government. Najibullah tried to flee Kabul, but his departure was blocked by Abdul Rashid Dostum. Najibullah sought sanctuary in the UN compound in Kabul. He remained there until September 1996 when the Taliban captured Kabul. The Taliban dragged Najibullah from the UN compound and hanged him from a traffic light post in the streets of the capital.