The territories of the Russian Empire consisting of modern Belarus were divided in 1921 between Poland and the Russian Soviet Federative Socialist Republic at the Treaty of Riga, thus ending the Polish-Soviet War. Thousands of Poles settled in the area following the peace treaty. In the elections of November 1922, a Belarusian party (in the "Blok Mniejszości Narodowych" coalition) obtained 14 seats in the Polish parliament (11 of them in the lower chamber, Sejm). In 1923, a new regulation was passed allowing for the Belarusian language to be used officially both in courts and in schools. Obligatory teaching of the Belarusian language was introduced in all Polish gymnasia in areas inhabited by Belarusians in 1927.