The communist party itself experienced deep internal rivalries between the Khalqists and Parchamites; in September 1979, People's Democratic Party General Secretary Nur Mohammad Taraki was assassinated under orders of the second-in-command, Hafizullah Amin, which soured relations with the Soviet Union. With fears rising that Amin was planning to switch sides to the United States, the Soviet government, under leader Leonid Brezhnev, decided to deploy the 40th Army across the border on 24 December 1979. Arriving in the capital Kabul, they staged a coup (Operation Storm-333), killing General Secretary Amin and installing Soviet loyalist Babrak Karmal from the rival faction Parcham. The Soviet invasion was based on the Brezhnev Doctrine.