Serfdom in Poland became the dominant form of relationship between peasants and nobility in the 17th century, and was a major feature of the economy of the Polish–Lithuanian Commonwealth, although its origins can be traced back to the 12th century. The first steps towards the abolition of serfdom were enacted in the Constitution of 3 May 1791, and it was essentially eliminated by the Połaniec Manifesto. However, these reforms were nullified partly by partition of Poland. Frederick the Great had abolished serfdom in his territories gained from the first partition of Poland. Over the course of the 19th century, it was gradually abolished on Polish and Lithuanian territories under foreign control, as the region began to industrialize. In the early days of the Kingdom of Poland under the Piast Dynasty in the 10th and 11th centuries, the social class of peasantry was among the several classes that developed. The peasants had the right to migrate, to own land, and were entitled to certain forms of judicial recourse in exchange for specific obligations toward their feudal lords. Over time, more peasants became dependent on feudal lords. This occurred in various ways; the granting of lands together with their inhabitants to a lord by the king, debt bondage, and peasants subjecting themselves to a local lord in exchange for protection. There were several groups of peasants who had varying levels of rights, and their status changed over time, gradually degrading from a yeoman-like status to full serfdom. Conversely, the least privileged class of the bondsmen, the niewolni or outright slaves (formed primarily from prisoners-of-war), gradually disappeared over the same period. By the late 12th century, peasantry could be divided into the free peasants (wolni or liberi), with the right to leave and relocate, and bonded subjects (poddani or obnoxii), without the right to leave. All peasants who held land from a feudal lord had to perform services or deliver goods to their lord.