text: The clear definition of the royal servants' liberties distinguished them from all other privileged groups, whose military obligations remained theoretically unlimited. From the 1220s, the royal servants were regularly called noblemen and started to develop their own corporate institutions at the county level. In 1232, the royal servants of Zala County asked Andrew II to authorize them "to judge and do justice", stating that the county had slipped into anarchy. The king granted their request and Bartholomew, Bishop of Veszprém, sued one Ban Oguz for properties before their community.
  The first Mongol invasion of Hungary in 1241 proved the importance of well-fortified locations and heavily armored cavalry. In the following decades, Béla IV of Hungary () gave away large parcels of the royal demesne, expecting that the new owners would build stone castles there. Béla's burdensome castle-building program was unpopular, but achieved his aim: almost 70 castles were built or reconstructed during his reign. More than half of the new or reconstructed castles were in noblemen's domains. Most new castles were erected on rocky peaks, mainly along the western and northern borderlands. The spread of stone castles profoundly changed the structure of landholding, because castles could not be maintained without proper income. Lands and villages were legally attached to each castle, and castles were thereafter always transferred and inherited along with these "appurtenances".