The defeat of the initial military rebellion against the Republican government in Barcelona by forces of the Generalitat and workers' militias placed Catalonia firmly in the Republican camp. The loyalist victory allowed to the workers' self-armed militias, predominantly anarchists, to become the real power of the streets, which meant the beginning of a harsh repression in Catalonia against those elements of being "fascist" or right-wing sympathizers. Both the Generalitat and the central government were unable to stop the arbitrary revolutionary violence. During the war, there were two powers coexisting in Catalonia: the "de jure" power of the Generalitat and the "de facto" power of the armed popular militias. In order to begin the recovering of some control of the situation, Companys authorized on July 21 the establishment of a joint body by the different Catalan republican parties and the anarchist CNT and socialist UGT trade unions, The Central Committee of Antifascist Militias of Catalonia (CCMA), becoming the effective Catalan government until its dissolution, two months later, replaced by a new government of the Generalitat which included anarchist ministers. Throughout Catalonia many sectors of the economy fell under the control of the CNT and the UGT, where workers' self-management was implemented. These included any kind of industry and services and thousands of dwellings previously owned by the upper classes. Initially, the newly collectivized factories encountered various problems. In response to these problems, the Generalitat, backed by the CNT approved a decree on "Collectivization and Workers' Control" on 24 October 1936. Under this decree all firms with more than 100 workers were to be collectivized and those with 100 or less could be collectivized if a majority of workers agreed. Violent confrontations between the workers' parties culminated in the defeat of the CNT-FAI and POUM in the 1937 May Days, against whom the PSUC unleashed strong repression. The local situation resolved itself progressively in favor of the Generalitat, but at the same time the Generalitat partially lost its autonomous power within republican Spain.