The Treaty of Kępno (Polish: umowa kępińska, układ w Kępnie) was an agreement between the High Duke of Poland and Wielkopolska Przemysł II and the Duke of Pomerania Mestwin II (sometimes rendered as "Mściwój") signed on February 15, 1282, which transferred the suzerainty over Gdańsk Pomerania (Pomeralia) to Przemysł. As a result of the treaty Przemysł adopted the title dux Polonie et Pomeranie (Duke of Poland and Pomerania).
Mestwin, per the agreement, retained de facto control over the province until his death in 1294, at which time Przemysł, who was already the de jure ruler of the territory, took it over in practice. According to some sources, it's possible that Mestwin kept full control of the province and the agreement merely stipulated that whichever ruler lived longer would take over the others territory. The treaty was, per custom, affirmed and approved by an assembly of nobles of both Pomerania and Wielkopolska.
The merger of Gdańsk Pomerania with Przemysł's other Polish provinces of Poznań, Wielkopolska, and Kraków was an important step in the process of reunification of Poland, after its feudal break up, which took place after the death of Bolesław III Wrymouth in 1138. The year after taking full control of Pomerania, Przemysł was crowned as king of Poland in Kraków. In the following year (1296) however, he was assassinated by agents of the Margrave of Brandenburg and some Polish nobles (the Nałęcz family), as both parties opposed the rise of a strong central power in Poland. Przemysł's realm, including Pomerania, became the subject of a civil war between Wenceslaus II of Bohemia and Władysław I the Elbow-high, both of whom at some point crowned themselves as kings of Poland.
The immediate effect of the treaty was that Mestwin and Przemysł began to carry out a single foreign policy, particularly in regard to Brandenburg and Western Pomerania. Additionally, Przemysł appointed several of his trusted men from Wielkopolska to offices in Gdansk and the surrounding area.
The treaty was followed up with several subsequent extensions and agreements. These included meetings in Nakło (1284), Słupsk (1287), Rzepka (1288) and once again Nakło (1291). The meeting in Słupsk in November 1284 was particularly important as it was also attended by the Duke of Szczecin-Pomerania (one of the duchies of Western Pomerania), Bogusław IV of the Griffins dynasty. The three rulers (Przemysł, Mestwin and Bogusław) concluded a mutual-defense alliance, directed against the expansionistic policies of Brandenburg, and it was agreed that Bogusław was to inherit Pomerania in case if both Przemysł and Mestwin died without heirs. This alliance was reaffirmed at the meeting in 1291 at Nakło. Despite the fact that Bogusław outlived both Mestwin and Przemysł, events on the ground and subsequent political developments, such as the struggle between Wenceslaus and Władysław the Elbow-high, meant that the provisions of the Nakło agreement were never implemented and Bogusław did not succeed come to acquire control over Pomeralia.
As part of the treaty Przemysł also granted the town of Kępno municipal rights, based on those of Kalisz.