Communists under the leadership of Nur Muhammad Taraki seized power in Afghanistan on April 27, 1978. The new regime—which was divided between Taraki's extremist Khalq faction and the more moderate Parcham—signed a treaty of friendship with the Soviet Union in December of that year. Taraki's efforts to improve secular education and redistribute land were accompanied by mass executions (including of many conservative religious leaders) and political oppression unprecedented in Afghan history, igniting a revolt by mujahideen rebels. Following a general uprising in April 1979, Taraki was deposed by Khalq rival Hafizullah Amin in September. Amin was considered a "brutal psychopath" by foreign observers; even the Soviets were alarmed by the brutality of the Afghan communists, and suspected Amin of being an agent of the U.S. Central Intelligence Agency (CIA), although that was not the case. By December, Amin's government had lost control of much of the country, prompting the Soviet Union to invade Afghanistan, execute Amin, and install Parcham leader Babrak Karmal as president.