secured to the nobility of other countries. Over time, each new monarch ceded to them further privileges. Those privileges became the basis of the Golden Liberty in the Polish–Lithuanian Commonwealth. Despite having a king, Poland was considered the 'nobility's Commonwealth' because Royal elections in Poland were in the hands of members of a hereditary class. Poland was therefore the domain of this class, and not that of the king or the ruling dynasty. This arose in part because of the extinction of male heirs in the original royal dynasties: first, the Piasts, then the Jagiellons. As a result, the nobility took it upon itself to choose "the Polish king" from among the dynasties' matrilinial descendants. Poland's successive kings granted privileges to the nobility upon their election to the throne – the privileges having been specified in the king-elect's Pacta conventa – and at other times, in exchange for ad hoc leave to raise an extraordinary tax or a pospolite ruszenie, a military call up. Poland's nobility thus accumulated a growing array of privileges and immunities. In 1355 in Buda King Casimir III the Great issued the first country-wide privilege for the nobility, in exchange for their agreeing that if Casimir had no male heirs, the throne would pass to his nephew, Louis I of Hungary. Casimir further decreed that the nobility would no longer be subject to 'extraordinary' taxes or have to use their own funds for foreign military expeditions. Casimir also promised that when the royal court toured, the king and the court would cover all expenses, instead of requiring facilities to be provided by the local nobility. Privilege of Koszyce and others In 1374 King Louis of Hungary approved the Privilege of Koszyce (przywilej koszycki) to guarantee the Polish throne for his daughter, Jadwiga. He broadened the definition of membership of the nobility and exempted the entire class from all but one tax (łanowy) a limit of 2 groszes per łan of land, Old Polish units of measurement. In addition, the King's right to raise taxes was effectively abolished: no new taxes would be levied without the agreement of the nobility. Henceforth, district offices were also reserved exclusively for local nobility, as the Privilege of Koszyce forbade the king to grant official posts and major Polish castles to foreign knights. Finally, the privilege obliged the king to pay indemnities to nobles injured or taken captive during a war