The anti-fascist communist-led Partisan movement, based on pan-Yugoslav ideology, emerged in early 1941, under the command of Croatian-born Josip Broz Tito, spreading quickly into many parts of Yugoslavia. The 1st Sisak Partisan Detachment, often hailed as the first armed anti-fascist resistance unit in occupied Europe, was formed in Croatia, in the Brezovica forest near the town of Sisak. As the movement began to gain popularity, the Partisans gained strength from Croats, Bosniaks, Serbs, Slovenes, and Macedonians who believed in a unified, but federal, Yugoslav state.
By 1943, the Partisan resistance movement had gained the upper hand, against the odds, and in 1945, with help from the Soviet Red Army (passing only through small parts such as Vojvodina), expelled the Axis forces and local supporters. The ZAVNOH, state anti-fascist council of people's liberation of Croatia, functioned since 1944 and formed an interim civil government. NDH's ministers of War and Internal Security Mladen Lorković and Ante Vokić tried to switch to Allied side. Pavelić was in the beginning supporting them but when he found that he would need to leave his position he imprisoned them in Lepoglava prison where they were executed. By the end of 1941 Ustashas seriously negotiated with the Partisans about organising combined Ustashi-Communist government but that failed when Axis states attacked SSSR.
Following the defeat of the Independent State of Croatia at the end of the war a large number of Ustaše, and civilians supporting them (ranging from sympathisers, young conscripts, anti-communists, and ordinary serfs who were motivated by Partisan atrocities) attempted to flee in the direction of Austria hoping to surrender to British forces and to be given refuge. They were instead interned by British forces and then returned to the Partisans. A large number of these persons were killed in what has come to be called the Bleiburg massacre.