It was founded on November 24, 1918, as Party of Communists in Hungary, and was in power between March and August 1919 when Béla Kun ran the short-lived Hungarian Soviet Republic.
After the war, they regained power, and their membership rose up quickly, which led to Mátyás Rákosi suppressing other parties in the country besides the social democrats (which were aligned with them) to form a one-party state.
Nonetheless, the political instability of the government under Mihály Károlyi and the growing popularity of the Bolshevik movement prompted the Social Democrats to seek a coalition with the KMP.
He also took steps towards normalising foreign relations with the Triple Entente powers in an effort to gain back some of the land that Hungary was set to lose in the postwar negotiations.
For the 133 days that the Hungarian Soviet Republic existed, the KMP concentrated mostly on trying to fix the widespread economic chaos that had resulted from Hungary's defeat in World War I.
Opposition began to grow, led by Miklós Horthy, and in June, an attempted coup made the KMP launch a violent terror campaign through its secret police.
The fall of the Soviet Republic was followed by a year-long anticommunist purge, known as the White Terror, by the new nationalist government under István Bethlen in which anywhere from 1,000 to 5,000 people were killed, and thousands more were imprisoned and tortured.
Kun's actions in Russia, most notably the organization of a massacre of White Russian prisoners-of-war in 1921, drew censure from the Soviet leader Vladimir Lenin and other prominent Bolsheviks.
In late 1941, following Germany's invasion of the Soviet Union, the Central Committee advised Party members to work with non-Communist resistance groups in order to present a united anti-German front.
Attempts to scale back the involvement on the German end failed, and so, with the Red Army approaching the country's borders, Horthy tried to declare Hungary a neutral state.
The move backfired horrendously; the Arrow Cross Party forces seized the capital, took power, and set the stage for a four-month battle that claimed thousands of lives and left Budapest in ruins.