In 1945, Yugoslavia was liberated by the partisan resistance and soon became a socialist federation known as the People's Federal Republic of Yugoslavia. Slovenia joined the federation as a constituent republic, led by its own pro-Communist leadership.