Poland defeated Western Ukraine in the Polish–Ukrainian War, but failed against the Bolsheviks in an offensive against Kyiv. According to the Peace of Riga, western Ukraine was incorporated into Poland, which in turn recognised the Ukrainian Soviet Socialist Republic in March 1919. With establishment of the Soviet power, Ukraine lost half of its territory, while Moldavian autonomy was established on the left bank of the Dniester River. Ukraine became a founding member of the Union of Soviet Socialist Republics in December 1922.