When the People's Democratic Party of Afghanistan (PDPA) came to power in a military coup in 1978, the PDPA regime declared their number one enemy to be the PYO-led Maoist movement. All people belonging to the Maoist movement were arrested and killed indiscriminately. Thousands of Maoists and their allies were killed. The leaderless remnants of the Maoist movement formed several organizations to fight the PDPA regime and resist the Soviet invasion of Afghanistan. During this period, some communist groups became more closely aligned with Islamic mujahideen groups of a type they had previously opposed.