thumb|330px|Territorial changes on the Hungary-Austrian Galicia border, later Slovakia-Poland border, between 1902 and 1958 (<span style="color:red;">red parts</span> – to Austrian Galicia/Poland; <span style="color:green;">green parts</span> – to Hungary/Slovakia)
thumb|250px|Territorial changes on the Poland-Czechia border between 1918 and 1958
Border conflicts between Poland and Czechoslovakia began in 1918 between the Second Polish Republic and First Czechoslovak Republic, both newly independent states. The conflicts centered on the disputed areas of Cieszyn Silesia, Orava Territory and Spiš. After World War II they broadened to include areas around the cities of Kłodzko and Racibórz, which until 1945 had belonged to Germany. The conflicts became critical in 1919 and were finally settled in 1958 in a treaty between the Polish People's Republic and the Czechoslovak Socialist Republic.
Before World War I
Before the First World War both Spiš and Orava were multi-ethnic areas. The inhabitants of the northernmost parts of both lands were predominantly Gorals, whose dialect and customs were in many ways similar to those of the Podhale Gorals. Another area inhabited by Gorals was situated in Čadca area. At the end of 19th century tourism in and around the Tatra Mountains became very popular among the Polish educated public and the folklore of the Podhale Gorals was heavily romanticized by writers and artists. Because of their archaic Polish basis, the Goral dialects became a popular object of study among linguists dealing with the history of the Polish language.
As a result, by the end of the 19th century Polish intellectuals commonly saw the Goral speaking areas in Spiš, Orava and around Čadca as being ethnographically Polish just like Podhale, irrespective of their inhabitants' actual national consciousness (or lack of it). The exception was northeastern Orava, with an influx of Polish or Polish-educated priests into the local Catholic parishes and some circulation of the Polish-language newspaper Gazeta Zakopiańska from nearby Podhale.
Creation of Poland and Czechoslovakia
After the end of World War I, both of the two newly independent states of the Second Polish Republic and First Czechoslovak Republic claimed the area of Cieszyn Silesia. Czechoslovakia claimed the area partly on strategic and ethnic grounds, but especially on economic and historic grounds. The disputed area was part of the historic Czech lands of the Bohemian Crown. The only railway from Czech territory to eastern Slovakia ran through this area (Košice-Bohumín Railway), and access to the railway was critical for Czechoslovakia: the newly formed country was at war with Béla Kun's revolutionary Hungarian Soviet Republic, which was attempting to re-establish Hungarian sovereignty over Slovakia. The area is also very rich in black coal, and it was the most industrialized region of all Austria-Hungary. The important Třinec Iron and Steel Works are also located here. All these raised the strategic importance of this region to Czechoslovakia. On the other hand, most of the population was Polish, despite substantial Czech and German minorities.
The Polish side based its claim to the area on ethnic criteria: a majority of the area's population was Polish according to the last (1910) Austro-Hungarian census.
Two local self-government councils, Polish and Czech, were created. Initially, both national councils claimed the whole of Cieszyn Silesia for themselves, the Polish Rada Narodowa Księstwa Cieszyńskiego in its declaration "Ludu śląski!" of 30 October 1918 and the Czech Národní výbor pro Slezsko in its declaration of 1 November 1918. On 31 October 1918, in the wake of World War I and the dissolution of Austria-Hungary, most of the area was taken over by local Polish authorities. The short-lived interim agreement of 2 November 1918 reflected the inability of the two national councils to come to final delimitation,
At noon on 30 September, Poland gave an ultimatum to the Czechoslovak government that demanded the immediate evacuation of Czechoslovak troops and police and gave Prague time until noon the following day. At 11:45 a.m. on 1 October the Czechoslovak foreign ministry called the Polish ambassador in Prague and told him that Poland could have what it wanted. The Polish Army, commanded by General Władysław Bortnowski, annexed an area of 801.5 km<sup>2</sup> with a population of 227,399 people.
First Vienna Award
In November 1938, Poland crossed into Slovakia where a minor firefight took place at Spisz, resulting in two fatalities on the Polish side, before the Slovak withdrawal. Poland occupied some northern parts of Slovakia and received territories around Suchá Hora and Hladovka, around Javorina, and in addition the territory around Lesnica in the Pieniny Mountains, a small territory around Skalité and some other very small border regions. Poland officially received the territories on 1 November 1938.
World War II
The First Slovak Republic received back both the territories lost in 1938 and the territories lost in 1920–1924. This re-annexation happened in October 1939 (officially confirmed on 24 November 1939) when Slovakia supported Nazi Germany's attack on Poland in September 1939. The annexation by the puppet state of Slovakia saved the Slovak and a smaller Polish population of the area from the naked terror of Nazi Germany as it was practised in the General Government until Slovakia agreed to take part in the Holocaust, but even then the genocidal policy was directed exclusively against the Jews and the Roma.
In January 1945, these border territories were occupied by the Soviet Red Army. The inhabitants of Orava and Spiš (including the territories lost by Czechoslovakia in 1920–1924) created authorities similar to those in the remaining Czechoslovakia (Slovakia ceased to exist as an independent state) and sought to prevent Polish authorities, which were trying to recover the territories they had before World War II, from entering the region. The Czechoslovak President Beneš, however, decided to give the territories regained during World War II (i.e. northern Spiš and northern Orava) to Poland again (the corresponding formal act was signed on 20 May 1945), although a Slovak organised poll in the territories showed support of the population in favour of Czechoslovakia. There were many protests in the form of delegations visiting the president, petitions to Prague and Poland, protests by American Slovaks and protests by the Slovak clergy. Despite these, on 20 May 1945, the pre-World War II borders between Czechoslovakia and Poland were restored.
Postwar era
In 1945 the border between Poland and Czechoslovakia was set at the 1920 line.
Polish troops then occupied northern Orava and Spiš on 17 July 1945. There were armed clashes and fatalities in some villages over the following two years. Slovaks from the Polish part of Spiš settled mainly in the newly created industrial town of Svit near Poprad, Kežmarok, Poprad, and in depopulated German villages (from which the German inhabitants had been previously expelled) near Kežmarok. Slovaks from the Polish part of Orava settled mainly in Czech Silesia, and in depopulated German villages in the Czech lands (Sudetenland).
On 10 March 1947, a treaty guaranteeing basic rights for Slovaks in Poland was signed between Czechoslovakia and Poland. As a result, 41 Slovak basic schools and 1 high school were opened in Poland. Most of these however were shut down in the early sixties because of lack of Slovak teachers.
On 13 June 1958, in Warsaw, the two countries signed a treaty confirming the border at the line of January 1, 1938 (that is, returning to the situation before the Nazi-imposed Munich Agreement transferred territory from Czechoslovakia to Poland), and since then there have been no conflicts regarding this matter.
In March 1975, Czechoslovakia and Poland modified their border along the Dunajec to permit Poland to construct a dam in the Czorsztyn and Niedzica region, southeast of Kraków.
The present era
In 2005, some further minor border adjustments between Poland and Slovakia came into force:
In 2020, a small unit of the Polish Land Forces occupied the village of Pelhřimovy in the Czech Republic, near Slezské Rudoltice. The Polish troops had apparently been deployed to construct a new border checkpoint, and inadvertently crossed into the Czech Republic. They remained for two weeks until a Czech police delegation arrived at the village and ordered them to leave.
