After the fall of Nazi Germany, Soviet troops occupied all of the country. So Hungary gradually became a communist satellite state of the Soviet Union. After 1948, Communist leader Mátyás Rákosi established Stalinist rule in the country. He forced collectivization and a planned economy. This led to the 1956 Hungarian Revolution. Hungary withdrew from the Warsaw Pact. But the Soviets sent in over 150,000 troops and 2,500 tanks. Nearly a quarter of a million people left the country during the brief time that the borders were open in 1956. János Kádár became leader of the communist party. In 1991 Soviet military presence in Hungary ended, and the transition to a market economy began.