Toward the end of World War II, the Soviet Army occupied Hungary, with the country coming under the Soviet Union's sphere of influence. Immediately after World War II, Hungary was a multiparty democracy, and elections in 1945 produced a coalition government under Prime Minister Zoltán Tildy.