After the end of the Central Powers in November 1918, the commander signed an agreement with the Temporary Council of the Suwałki Region and let the city back into Poland. However, the German army stayed in the city. In February 1919 the local people voted in the first elections to the Polish Sejm, but soon after the German commanders changed their minds and kept the Polish soldiers from the area and in May passed it to Lithuania to control. By the end of July the Paris Peace Conference gave the city to Poland and the Lithuanians left the city, but some of the Polish lands were left on the Lithuanian side of the border while several Lithuanian villages were left on the Polish side of the border. This led to the Sejny Uprising on August 23, 1919. To make the city safe, the next day Polish soldiers entered Suwałki. There was a Polish-Lithuanian War and for several days limited fights were fought for the control over Suwałki, Sejny and other towns in that area. The war ended because of the Entente in mid-September. During the Polish-Bolshevik War the city was captured by the Reds and after the Battle of Warsaw it was again given to the Lithuanians, but it was taken by the Polish Army with few losses soon after.