The USSR sent weapons to the Stalinist faction in the Spanish Republic, hoping after the war they would become a puppet state.
The efforts of the Anarchists during the war (establishing stateless, horizontal power structures) were undermining that effort, thus the Stalinists turned on them (and the anti-stalinist Marxist faction) mid-war, calling them 'secret fascists' helping the enemy, and proceeded to round them up for execution.