In the 12th century the lower Łeba marked the eastern border of the Land of Słupsk-Sławno, ruled by the Pomeranian (Griffin) duke Ratibor I and his descendants, while the territory around the castellany of Białogarda was a possession of the Pomerelian duke Sobieslaw I of the Samborides dynasty. After Poland regained Pomerelia in 1294, the Łeba formed the boundary between the Polish part of Pomerania and the Duchy of Pomerania. From 1308, after the Teutonic takeover of Danzig (Gdańsk) and the Treaty of Soldin (Myślibórz), the river formed the western border of the Order's Pomerelian lands with the Duchy of Pomerania until 1466, when Poland regained Pomerelia. From that time the mouth of the Łeba on the Baltic coast marked the north-easternmost point of the Holy Roman Empire till its dissolution in 1806. The adjacent Pomerelian lands of Lauenburg and Bütow (Lębork i Bytów) became a fief of the Polish Crown with the Second Peace of Thorn (1466).