Only a year later, the town was captured by the Soviet Russia in the course of the Polish–Soviet War. To ensure the right of passage through Lithuanian territory, on 12 July 1920 the Soviet authorities signed the Soviet-Lithuanian Treaty of 1920, in which it ceded the area to Lithuania. On July 19 the Lithuanians recaptured the town. After the Battle of Warsaw the Bolshevik forces were defeated and the Polish Army attacked the Lithuanian forces. As the Paris Peace Conference established the Polish-Lithuanian border roughly correspondent to the "status quo ante bellum", the Lithuanian forces were forced to withdraw from the town and on 31 August 1920 the town once again passed to Polish hands. However, the Lithuanian authorities still claimed the area and Lithuanian successfully counterattacked on September 2. However, the Polish Army recaptured the town on September 9. The following day the last of the Lithuanian units retreated to the other side of the border and on October 7 a cease fire agreement was signed, leaving Sejny on the Polish side of the border. In the interbellum, the town continued to be claimed by Lithuania.