Between the beginning of the 16th century and the middle of the 17th century, there were about 800 functioning towns and cities in the GDL that had the traits of city-like settlements, however only a small number of them had rights to self-rule. During the following 400 years after the establishment of the first self-governing city, Vilnius, in 1387, up until 1795, it is estimated that there were approximately 250 self-ruling cities that had the kind of Magdeburg rights generally given in the GDL. The Magdeburg rights were the primary legal act that set a city apart from other settlements that did not have privileges issued to them. One of these cities was Biržai, which during the existence of the GDL belonged to the Radvila family, who were the dukes of Biržai and Dubingai and one of the most powerful noble families in the GDL. It was their private city.