Karmal became involved in Marxist political activities while a student at Kabul University, where he gained a law degree. He was a founding member of the People's Democratic Party of Afghanistan (PDPA) and served in the National Assembly from 1965 until 1973.
When the party split (1967) into the Khalq and the Parcham factions, he became leader of the more moderate Parcham faction. The factions reunited in 1977, and in April 1978 seized control of Afghanistan. Karmal was initially deputy prime minister but following the rise of the rival Khalq faction he was soon 'exiled' as ambassador to Prague.
The PDPA was attempting to modernize the country in line with Marxist ideas, but there was major unrest. In December 1979 the Soviets invaded Afghanistan and called Karmal back to be President of the Democratic Republic of Afghanistan.
Following the fighting with the mujahedin in the 1980s Moscow came to regard Karmal as a failure and blamed him for the problems. In May 1986 he was replaced as party leader by Mohammad Najibullah, and six months later he was relieved of the presidency. Karmal moved to Moscow, where he remained until his death.